@dra2020/baseclient 1.0.100 → 1.0.101

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.
@@ -21,6 +21,7 @@ export function polyPackSize(coords: any): number
21
21
  // Null feature?
22
22
  if (coords == null || (coords.length !== undefined && coords.length == 0)) return 0;
23
23
 
24
+ if (! Array.isArray(coords)) return 0;
24
25
  let depth = Util.depthof(coords);
25
26
  if (depth == 3) coords = [[ coords ]];
26
27
  else if (depth == 4) coords = [ coords ]; // normalize to multipolygon
@@ -223,6 +224,8 @@ export function polyPack(coords: any, prepack?: PolyPack): PolyPack
223
224
  coords = coords.geometry.coordinates;
224
225
 
225
226
  // Transparently handle polygon or multi-polygon
227
+ if (! Array.isArray(coords)) return null;
228
+
226
229
  let depth = Util.depthof(coords);
227
230
  if (depth == 2) coords = [ [ [ coords ] ] ];
228
231
  else if (depth == 3) coords = [ [ coords ] ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dra2020/baseclient",
3
- "version": "1.0.100",
3
+ "version": "1.0.101",
4
4
  "description": "Utility functions for Javascript projects.",
5
5
  "main": "dist/baseclient.js",
6
6
  "types": "./dist/all/all.d.ts",