Skip to content

Commit

Permalink
feature/add-senatorial-districts
Browse files Browse the repository at this point in the history
  • Loading branch information
adexphem committed Sep 27, 2020
1 parent 63d33e2 commit 62d2566
Show file tree
Hide file tree
Showing 2 changed files with 195 additions and 3 deletions.
11 changes: 11 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,17 @@ module.exports = {
return nigeriaStates.state;
});
},
senatorial_districts: function (state) {
state = _lower(state);

if (!state || state == "") {
throw new Error('Invalid Nigeria State');
}

return statesAndLocalGov.find(function (nigeriaStates) {
return (_lower(nigeriaStates.state) === _lower(state)) ? nigeriaStates.senatorial_districts : 'not found'
});
},
lgas: function (state) {
state = _lower(state);

Expand Down
Loading

0 comments on commit 62d2566

Please sign in to comment.