@wemap/geo 9.0.0-alpha.3 → 9.0.0-alpha.4

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/package.json CHANGED
@@ -13,7 +13,7 @@
13
13
  "directory": "packages/geo"
14
14
  },
15
15
  "name": "@wemap/geo",
16
- "version": "9.0.0-alpha.3",
16
+ "version": "9.0.0-alpha.4",
17
17
  "bugs": {
18
18
  "url": "https://github.com/wemap/wemap-modules-js/issues"
19
19
  },
@@ -31,5 +31,5 @@
31
31
  "@wemap/logger": "^9.0.0-alpha.1",
32
32
  "@wemap/maths": "^8.1.0"
33
33
  },
34
- "gitHead": "b51ee342c82a98b401288195148d5293662212b7"
34
+ "gitHead": "f3e01640197d58e16362feff33b9a02c36144e31"
35
35
  }
@@ -71,6 +71,10 @@ class Level {
71
71
  */
72
72
  static fromString(str) {
73
73
 
74
+ if (str === null) {
75
+ return null;
76
+ }
77
+
74
78
  if (typeof str !== 'string') {
75
79
  throw Error(`argument must be a string, got ${typeof str}`);
76
80
  }
@@ -226,12 +230,15 @@ class Level {
226
230
 
227
231
  /**
228
232
  * @param {null|number|[number, number]} level
229
- * @returns {string}
233
+ * @returns {string|null}
230
234
  */
231
235
  static toString(level) {
232
236
  if (this.VERIFY_TYPING) {
233
237
  this.checkType(level);
234
238
  }
239
+ if (level === null) {
240
+ return null;
241
+ }
235
242
  return Array.isArray(level) ? level[0] + ';' + level[1] : String(level);
236
243
  }
237
244