nigerian-states-and-lgas
Version:
A minimalist package that contains the full list of Nigerian States and respective local-governments
19 lines (15 loc) • 433 B
text/typescript
import { states as allStates } from "./states";
export const lgas = (
state: string
): string[] | undefined => {
const foundState = Object.values(allStates).find(
(oneState) =>
oneState.state.match(new RegExp(state, "i"))
);
if (foundState && foundState.lgas) {
return foundState.lgas;
}
};
export const all = () => allStates;
export const states = (): string[] =>
allStates.map((state) => state.state);