monagree-locs 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -0
- package/dist/index.js +1 -0
- package/package.json +34 -0
- package/src/classes.ts +17 -0
- package/src/index.ts +30 -0
- package/src/locs.ts +5681 -0
- package/tsconfig.json +15 -0
package/README.md
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Monagree Location Picker
|
|
2
|
+
|
|
3
|
+
> Only showing locations in Nigeria for now
|
|
4
|
+
|
|
5
|
+
Please enjoy this accurate & up-to-date location package from the open source team at Monagree. Monagree provides tools for devs to build ecommerce and logistics websites easily. Check out our javascript framework (CLI) on npm [monagree-tools](https://www.npmjs.com/package/monagree-tools "Monagree JS Framework").
|
|
6
|
+
|
|
7
|
+
## Become a Monagree Developer
|
|
8
|
+
|
|
9
|
+
Start using awesome tools developed by Monagree to build cool ecommerce and logistics apps & Websites. Join now at [Monagree For Developers](https://developers.monagree.com "Monagree Developer Dashboard")
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var a1_0x2ca711=a1_0x2b0a;(function(_0x5d94d1,_0x4c5a66){var _0x2fc34d=a1_0x2b0a,_0x51557c=_0x5d94d1();while(!![]){try{var _0x526aa5=parseInt(_0x2fc34d(0x124))/0x1+-parseInt(_0x2fc34d(0x122))/0x2+-parseInt(_0x2fc34d(0x123))/0x3*(-parseInt(_0x2fc34d(0x11f))/0x4)+-parseInt(_0x2fc34d(0x11b))/0x5*(-parseInt(_0x2fc34d(0x11a))/0x6)+parseInt(_0x2fc34d(0x12a))/0x7+-parseInt(_0x2fc34d(0x118))/0x8*(-parseInt(_0x2fc34d(0x121))/0x9)+-parseInt(_0x2fc34d(0x126))/0xa;if(_0x526aa5===_0x4c5a66)break;else _0x51557c['push'](_0x51557c['shift']());}catch(_0x21adc5){_0x51557c['push'](_0x51557c['shift']());}}}(a1_0x4ae8,0x386b7));Object[a1_0x2ca711(0x120)](exports,a1_0x2ca711(0x12c),{'value':!![]}),exports[a1_0x2ca711(0x119)]=exports[a1_0x2ca711(0x11c)]=void 0x0;var classes_1=require(a1_0x2ca711(0x12b)),locs_1=require('./locs');function getAllStatesInNigeria(){var _0x50e17b=a1_0x2ca711,_0x6023c2=[];for(var _0x3f8d61 in locs_1[_0x50e17b(0x125)]){if(locs_1[_0x50e17b(0x125)]['hasOwnProperty'](_0x3f8d61)){var _0x3d3305=locs_1[_0x50e17b(0x125)][_0x3f8d61];delete _0x3d3305[_0x50e17b(0x11e)],_0x6023c2[_0x50e17b(0x127)](new classes_1[(_0x50e17b(0x128))](_0x3f8d61,_0x3d3305));}}return _0x6023c2;}exports[a1_0x2ca711(0x11c)]=getAllStatesInNigeria;function a1_0x2b0a(_0x131b4a,_0x447b2b){var _0x4ae894=a1_0x4ae8();return a1_0x2b0a=function(_0x2b0aea,_0x58e5dc){_0x2b0aea=_0x2b0aea-0x118;var _0x5f50a5=_0x4ae894[_0x2b0aea];return _0x5f50a5;},a1_0x2b0a(_0x131b4a,_0x447b2b);}function getLgasByState(_0x1ff52f){var _0x3228e2=a1_0x2ca711,_0x21d6f8=[],_0x318cf3=locs_1[_0x3228e2(0x125)][_0x1ff52f];if(_0x318cf3)for(var _0x3e55ad in _0x318cf3[_0x3228e2(0x11d)]){if(_0x318cf3['lgas'][_0x3228e2(0x129)](_0x3e55ad)){var _0x52bee3=_0x318cf3[_0x3228e2(0x11d)][_0x3e55ad];_0x21d6f8[_0x3228e2(0x127)](new classes_1[(_0x3228e2(0x128))](_0x3e55ad,_0x52bee3));}}return _0x21d6f8;}exports[a1_0x2ca711(0x119)]=getLgasByState;function a1_0x4ae8(){var _0x1b5bec=['locs','721430LMooVE','push','mLoc','hasOwnProperty','634361BcxJKE','./classes','__esModule','296NIDkGn','getLgasByState','6WErRtc','762095bqqxHb','getAllStatesInNigeria','lgas','lga','4HTtgsC','defineProperty','2637wWxuHg','825496PzMpvB','817923cYYgZa','189462vlReRB'];a1_0x4ae8=function(){return _0x1b5bec;};return a1_0x4ae8();}
|
package/package.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "monagree-locs",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "States and LGAs in Nigeria (with GPS coordinates)",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
8
|
+
"build": "tsc",
|
|
9
|
+
"obs": "javascript-obfuscator dist --output dist"
|
|
10
|
+
},
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git+https://github.com/monagree/monagree-locs.git"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [
|
|
16
|
+
"Monagree",
|
|
17
|
+
"Nigeria",
|
|
18
|
+
"States",
|
|
19
|
+
"LGAs",
|
|
20
|
+
"GPS",
|
|
21
|
+
"Location"
|
|
22
|
+
],
|
|
23
|
+
"author": "Monagree",
|
|
24
|
+
"license": "ISC",
|
|
25
|
+
"bugs": {
|
|
26
|
+
"url": "https://github.com/monagree/monagree-locs/issues"
|
|
27
|
+
},
|
|
28
|
+
"homepage": "developers.monagree.com",
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"javascript-obfuscator": "^4.1.0",
|
|
31
|
+
"@types/node": "^20.10.8",
|
|
32
|
+
"typescript": "^5.3.3"
|
|
33
|
+
}
|
|
34
|
+
}
|
package/src/classes.ts
ADDED
package/src/index.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { mLoc } from "./classes";
|
|
2
|
+
import { locs } from "./locs";
|
|
3
|
+
|
|
4
|
+
export function getAllStatesInNigeria() {
|
|
5
|
+
const states:mLoc[] = []
|
|
6
|
+
for (const stateCode in locs) {
|
|
7
|
+
if (locs.hasOwnProperty(stateCode)) {
|
|
8
|
+
const state = locs[stateCode];
|
|
9
|
+
delete state['lga']
|
|
10
|
+
states.push(new mLoc(stateCode,state))
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
return states;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
export function getLgasByState(stateCode:string) {
|
|
18
|
+
const lgas:mLoc[] = []
|
|
19
|
+
const state = locs[stateCode]
|
|
20
|
+
if(state){
|
|
21
|
+
for (const lgaCode in state['lgas']) {
|
|
22
|
+
if (state['lgas'].hasOwnProperty(lgaCode)) {
|
|
23
|
+
const lga = state['lgas'][lgaCode];
|
|
24
|
+
lgas.push(new mLoc(lgaCode, lga))
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return lgas;
|
|
29
|
+
}
|
|
30
|
+
|