monagree-locs 1.0.2 → 1.0.3
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/dist/classes.js +11 -0
- package/dist/index.js +31 -1
- package/dist/locs.js +5684 -0
- package/package.json +5 -1
- package/src/classes.ts +0 -17
- package/src/index.ts +0 -30
- package/src/locs.ts +0 -5681
- package/tsconfig.json +0 -16
package/dist/classes.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mLoc = void 0;
|
|
4
|
+
var mLoc = /** @class */ (function () {
|
|
5
|
+
function mLoc(id, data) {
|
|
6
|
+
this.id = id;
|
|
7
|
+
this.data = data;
|
|
8
|
+
}
|
|
9
|
+
return mLoc;
|
|
10
|
+
}());
|
|
11
|
+
exports.mLoc = mLoc;
|
package/dist/index.js
CHANGED
|
@@ -1 +1,31 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getLgasByState = exports.getAllStatesInNigeria = void 0;
|
|
4
|
+
var classes_1 = require("./classes");
|
|
5
|
+
var locs_1 = require("./locs");
|
|
6
|
+
function getAllStatesInNigeria() {
|
|
7
|
+
var states = [];
|
|
8
|
+
for (var stateCode in locs_1.locs) {
|
|
9
|
+
if (locs_1.locs.hasOwnProperty(stateCode)) {
|
|
10
|
+
var state = locs_1.locs[stateCode];
|
|
11
|
+
delete state['lga'];
|
|
12
|
+
states.push(new classes_1.mLoc(stateCode, state));
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
return states;
|
|
16
|
+
}
|
|
17
|
+
exports.getAllStatesInNigeria = getAllStatesInNigeria;
|
|
18
|
+
function getLgasByState(stateCode) {
|
|
19
|
+
var lgas = [];
|
|
20
|
+
var state = locs_1.locs[stateCode];
|
|
21
|
+
if (state) {
|
|
22
|
+
for (var lgaCode in state['lgas']) {
|
|
23
|
+
if (state['lgas'].hasOwnProperty(lgaCode)) {
|
|
24
|
+
var lga = state['lgas'][lgaCode];
|
|
25
|
+
lgas.push(new classes_1.mLoc(lgaCode, lga));
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return lgas;
|
|
30
|
+
}
|
|
31
|
+
exports.getLgasByState = getLgasByState;
|