kenya-locations
Version:
A comprehensive and intuitive TypeScript package for working with Kenyan administrative divisions (counties, sub-counties, constituencies, and wards)
2 lines (1 loc) • 1.03 kB
JavaScript
;Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./area-zfFmEagr.cjs"),n=require("./counties-D9ZfM1Ad.cjs"),a=require("./maps-B_hwSl98.cjs"),r=a.buildLookupMap(t.areas,e=>e.name.toLowerCase()),u=a.buildGroupMap(t.areas,e=>e.name.toLowerCase()),s=a.buildLookupMap(t.localities,e=>e.name.toLowerCase()),c=a.buildLookupMap(n.counties,e=>e.name.toLowerCase()),i=a.buildGroupMap(t.areas,e=>e.locality),g=a.buildGroupMap(t.areas,e=>e.county);function l(){return t.areas}function y(e){return r.get(e.toLowerCase())}function p(e){return i.get(e)??[]}function L(e){return g.get(e)??[]}function A(e){const o=r.get(e.toLowerCase());if(o)return c.get(o.county.toLowerCase())}function f(e){const o=r.get(e.toLowerCase());if(o)return s.get(o.locality.toLowerCase())}function m(e){return u.get(e.toLowerCase())??[]}exports.getAreaByName=y;exports.getAreas=l;exports.getAreasByName=m;exports.getAreasInCounty=L;exports.getAreasInLocality=p;exports.getCountyOfArea=A;exports.getLocalityOfArea=f;