@turf/square-grid
Advanced tools
Comparing version 5.1.1 to 5.1.5
16
main.js
@@ -34,3 +34,3 @@ 'use strict'; | ||
options = options || {}; | ||
if (!helpers.isObject(options)) { throw new Error('options is invalid'); } | ||
if (!helpers.isObject(options)) throw new Error('options is invalid'); | ||
// var units = options.units; | ||
@@ -44,8 +44,8 @@ var properties = options.properties; | ||
// Input Validation | ||
if (cellSide === null || cellSide === undefined) { throw new Error('cellSide is required'); } | ||
if (!helpers.isNumber(cellSide)) { throw new Error('cellSide is invalid'); } | ||
if (!bbox) { throw new Error('bbox is required'); } | ||
if (!Array.isArray(bbox)) { throw new Error('bbox must be array'); } | ||
if (bbox.length !== 4) { throw new Error('bbox must contain 4 numbers'); } | ||
if (mask && ['Polygon', 'MultiPolygon'].indexOf(invariant.getType(mask)) === -1) { throw new Error('options.mask must be a (Multi)Polygon'); } | ||
if (cellSide === null || cellSide === undefined) throw new Error('cellSide is required'); | ||
if (!helpers.isNumber(cellSide)) throw new Error('cellSide is invalid'); | ||
if (!bbox) throw new Error('bbox is required'); | ||
if (!Array.isArray(bbox)) throw new Error('bbox must be array'); | ||
if (bbox.length !== 4) throw new Error('bbox must contain 4 numbers'); | ||
if (mask && ['Polygon', 'MultiPolygon'].indexOf(invariant.getType(mask)) === -1) throw new Error('options.mask must be a (Multi)Polygon'); | ||
@@ -85,3 +85,3 @@ var west = bbox[0]; | ||
if (mask) { | ||
if (intersect(mask, cellPoly)) { results.push(cellPoly); } | ||
if (intersect(mask, cellPoly)) results.push(cellPoly); | ||
} else { | ||
@@ -88,0 +88,0 @@ results.push(cellPoly); |
{ | ||
"name": "@turf/square-grid", | ||
"version": "5.1.1", | ||
"version": "5.1.5", | ||
"description": "turf square-grid module", | ||
"main": "main.js", | ||
"module": "main.mjs", | ||
"module": "main.es.js", | ||
"types": "index.d.ts", | ||
@@ -12,3 +12,3 @@ "files": [ | ||
"main.js", | ||
"main.mjs" | ||
"main.es.js" | ||
], | ||
@@ -18,2 +18,3 @@ "scripts": { | ||
"test": "node -r @std/esm test.js", | ||
"posttest": "node -r @std/esm ../../scripts/validate-es5-dependencies.js", | ||
"bench": "node -r @std/esm bench.js", | ||
@@ -41,7 +42,6 @@ "docs": "node ../../scripts/generate-readmes" | ||
"@std/esm": "*", | ||
"@turf/bbox-polygon": "^5.1.0", | ||
"@turf/truncate": "^5.1.0", | ||
"@turf/bbox-polygon": "^5.1.5", | ||
"@turf/truncate": "^5.1.5", | ||
"benchmark": "*", | ||
"rollup": "*", | ||
"rollup-plugin-buble": "*", | ||
"tape": "*", | ||
@@ -51,8 +51,8 @@ "write-json-file": "*" | ||
"dependencies": { | ||
"@turf/boolean-contains": "^5.1.0", | ||
"@turf/boolean-overlap": "^5.1.1", | ||
"@turf/distance": "^5.1.0", | ||
"@turf/helpers": "^5.1.0", | ||
"@turf/intersect": "^5.1.0", | ||
"@turf/invariant": "^5.1.0" | ||
"@turf/boolean-contains": "^5.1.5", | ||
"@turf/boolean-overlap": "^5.1.5", | ||
"@turf/distance": "^5.1.5", | ||
"@turf/helpers": "^5.1.5", | ||
"@turf/intersect": "^5.1.5", | ||
"@turf/invariant": "^5.1.5" | ||
}, | ||
@@ -59,0 +59,0 @@ "@std/esm": { |
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
16225
7
Updated@turf/boolean-overlap@^5.1.5
Updated@turf/distance@^5.1.5
Updated@turf/helpers@^5.1.5
Updated@turf/intersect@^5.1.5
Updated@turf/invariant@^5.1.5