@loaders.gl/gis
Advanced tools
Comparing version 4.0.0-alpha.21 to 4.0.0-alpha.22
@@ -55,4 +55,4 @@ "use strict"; | ||
function isCoord(array) { | ||
return Number.isFinite(array[0]) && Number.isFinite(array[1]); | ||
return Array.isArray(array) && Number.isFinite(array[0]) && Number.isFinite(array[1]); | ||
} | ||
//# sourceMappingURL=transform.js.map |
@@ -38,4 +38,4 @@ export function transformBinaryCoords(binaryFeatures, transformCoordinate) { | ||
function isCoord(array) { | ||
return Number.isFinite(array[0]) && Number.isFinite(array[1]); | ||
return Array.isArray(array) && Number.isFinite(array[0]) && Number.isFinite(array[1]); | ||
} | ||
//# sourceMappingURL=transform.js.map |
@@ -1,2 +0,2 @@ | ||
import type { BinaryFeatures } from '@loaders.gl/schema'; | ||
import type { BinaryFeatures, Feature } from '@loaders.gl/schema'; | ||
type TransformCoordinate = (coord: number[]) => number[]; | ||
@@ -17,4 +17,4 @@ /** | ||
*/ | ||
export declare function transformGeoJsonCoords(features: object[], fn: (coord: number[]) => number[]): object[]; | ||
export declare function transformGeoJsonCoords(features: Feature[], fn: (coord: number[]) => number[]): Feature[]; | ||
export {}; | ||
//# sourceMappingURL=transform.d.ts.map |
@@ -58,3 +58,3 @@ "use strict"; | ||
function isCoord(array) { | ||
return Number.isFinite(array[0]) && Number.isFinite(array[1]); | ||
return Array.isArray(array) && Number.isFinite(array[0]) && Number.isFinite(array[1]); | ||
} |
{ | ||
"name": "@loaders.gl/gis", | ||
"description": "Helpers for GIS category data", | ||
"version": "4.0.0-alpha.21", | ||
"version": "4.0.0-alpha.22", | ||
"license": "MIT", | ||
@@ -27,4 +27,4 @@ "publishConfig": { | ||
"dependencies": { | ||
"@loaders.gl/loader-utils": "4.0.0-alpha.21", | ||
"@loaders.gl/schema": "4.0.0-alpha.21", | ||
"@loaders.gl/loader-utils": "4.0.0-alpha.22", | ||
"@loaders.gl/schema": "4.0.0-alpha.22", | ||
"@mapbox/vector-tile": "^1.3.1", | ||
@@ -37,3 +37,3 @@ "@math.gl/polygon": "^3.5.1", | ||
}, | ||
"gitHead": "df5d670b136192b26941396e944f9c46be788e83" | ||
"gitHead": "0da838c506d1275383f2fd3d244d9c72b25397d2" | ||
} |
@@ -1,2 +0,2 @@ | ||
import type {BinaryFeatures, BinaryGeometry} from '@loaders.gl/schema'; | ||
import type {BinaryFeatures, BinaryGeometry, Feature} from '@loaders.gl/schema'; | ||
@@ -47,5 +47,5 @@ type TransformCoordinate = (coord: number[]) => number[]; | ||
export function transformGeoJsonCoords( | ||
features: object[], | ||
features: Feature[], | ||
fn: (coord: number[]) => number[] | ||
): object[] { | ||
): Feature[] { | ||
for (const feature of features) { | ||
@@ -58,8 +58,8 @@ // @ts-ignore | ||
function coordMap(array, fn) { | ||
function coordMap(array: unknown, fn: (coord: number[]) => number[]): unknown[] { | ||
if (isCoord(array)) { | ||
return fn(array); | ||
return fn(array as number[]); | ||
} | ||
return array.map((item) => { | ||
return (array as unknown[]).map((item) => { | ||
return coordMap(item, fn); | ||
@@ -69,4 +69,4 @@ }); | ||
function isCoord(array) { | ||
return Number.isFinite(array[0]) && Number.isFinite(array[1]); | ||
function isCoord(array: unknown) { | ||
return Array.isArray(array) && Number.isFinite(array[0]) && Number.isFinite(array[1]); | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
327322
+ Added@loaders.gl/loader-utils@4.0.0-alpha.22(transitive)
+ Added@loaders.gl/schema@4.0.0-alpha.22(transitive)
+ Added@loaders.gl/worker-utils@4.0.0-alpha.22(transitive)
- Removed@loaders.gl/loader-utils@4.0.0-alpha.21(transitive)
- Removed@loaders.gl/schema@4.0.0-alpha.21(transitive)
- Removed@loaders.gl/worker-utils@4.0.0-alpha.21(transitive)