monagree-locs 1.0.6 → 1.0.8

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.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  export interface mlocData {
2
2
  name: string;
3
3
  center: {
4
- lat: number;
5
- lon: number;
4
+ lat: string;
5
+ lon: string;
6
6
  };
7
7
  }
8
8
  export declare class mLoc {
@@ -11,6 +11,6 @@ export declare class mLoc {
11
11
  constructor(id: string, data: mlocData);
12
12
  getId(): string;
13
13
  getName(): string;
14
- getLatitude(): number;
15
- getLongitude(): number;
14
+ getLatitude(): string;
15
+ getLongitude(): string;
16
16
  }
package/dist/index.js CHANGED
@@ -38,7 +38,7 @@ var mState = /** @class */ (function () {
38
38
  for (var stateCode in nLoc) {
39
39
  if (nLoc.hasOwnProperty(stateCode)) {
40
40
  var state = nLoc[stateCode];
41
- delete state['lga'];
41
+ delete state['lgas'];
42
42
  states.push(new classes_1.mLoc(stateCode, state));
43
43
  }
44
44
  }
@@ -48,9 +48,9 @@ var mState = /** @class */ (function () {
48
48
  mState.getStateByCode = function (countryCode, stateCode) {
49
49
  if (locs_1.locs[countryCode]) {
50
50
  var nLoc = locs_1.locs[countryCode]['states'];
51
- if (nLoc[stateCode]) {
51
+ if (nLoc && nLoc[stateCode]) {
52
52
  var state = nLoc[stateCode];
53
- delete state['lga'];
53
+ delete state['lgas'];
54
54
  return new classes_1.mLoc(stateCode, state);
55
55
  }
56
56
  }
@@ -66,7 +66,7 @@ var mLga = /** @class */ (function () {
66
66
  var lgas = [];
67
67
  if (locs_1.locs[countryCode]) {
68
68
  var nLoc = locs_1.locs[countryCode]['states'];
69
- if (nLoc[stateCode]) {
69
+ if (nLoc && nLoc[stateCode]) {
70
70
  var nnLoc = nLoc[stateCode]['lgas'];
71
71
  for (var lgaCode in nnLoc) {
72
72
  if (nnLoc.hasOwnProperty(lgaCode)) {
@@ -81,9 +81,9 @@ var mLga = /** @class */ (function () {
81
81
  mLga.getLgaByCode = function (countryCode, stateCode, lgaCode) {
82
82
  if (locs_1.locs[countryCode]) {
83
83
  var nLoc = locs_1.locs[countryCode]['states'];
84
- if (nLoc[stateCode]) {
84
+ if (nLoc && nLoc[stateCode]) {
85
85
  var nnLoc = nLoc[stateCode]['lgas'];
86
- if (nnLoc[lgaCode]) {
86
+ if (nnLoc && nnLoc[lgaCode]) {
87
87
  var lga = nnLoc[lgaCode];
88
88
  return new classes_1.mLoc(lgaCode, lga);
89
89
  }
package/dist/locs.d.ts CHANGED
@@ -1 +1,28 @@
1
- export declare const locs: any;
1
+ export interface LocsMap {
2
+ [key: string]: {
3
+ name: string;
4
+ center: {
5
+ lat: string;
6
+ lon: string;
7
+ };
8
+ states?: {
9
+ [key: string]: {
10
+ name: string;
11
+ center: {
12
+ lat: string;
13
+ lon: string;
14
+ };
15
+ lgas?: {
16
+ [key: string]: {
17
+ name: string;
18
+ center: {
19
+ lat: string;
20
+ lon: string;
21
+ };
22
+ };
23
+ };
24
+ };
25
+ };
26
+ };
27
+ }
28
+ export declare const locs: LocsMap;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "monagree-locs",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "description": "States and LGAs in Nigeria (with GPS coordinates)",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",