@turf/projection
Advanced tools
Comparing version 5.1.0 to 5.1.5
16
main.js
@@ -63,10 +63,10 @@ '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 mutate = options.mutate; | ||
// Validation | ||
if (!geojson) { throw new Error('geojson is required'); } | ||
if (!geojson) throw new Error('geojson is required'); | ||
// Handle Position | ||
if (Array.isArray(geojson) && helpers.isNumber(geojson[0])) { geojson = (projection === 'mercator') ? convertToMercator(geojson) : convertToWgs84(geojson); } | ||
if (Array.isArray(geojson) && helpers.isNumber(geojson[0])) geojson = (projection === 'mercator') ? convertToMercator(geojson) : convertToWgs84(geojson); | ||
@@ -76,3 +76,3 @@ // Handle GeoJSON | ||
// Handle possible data mutation | ||
if (mutate !== true) { geojson = clone(geojson); } | ||
if (mutate !== true) geojson = clone(geojson); | ||
@@ -111,6 +111,6 @@ meta.coordEach(geojson, function (coord) { | ||
// if xy value is beyond maxextent (e.g. poles), return maxextent | ||
if (xy[0] > MAXEXTENT) { xy[0] = MAXEXTENT; } | ||
if (xy[0] < -MAXEXTENT) { xy[0] = -MAXEXTENT; } | ||
if (xy[1] > MAXEXTENT) { xy[1] = MAXEXTENT; } | ||
if (xy[1] < -MAXEXTENT) { xy[1] = -MAXEXTENT; } | ||
if (xy[0] > MAXEXTENT) xy[0] = MAXEXTENT; | ||
if (xy[0] < -MAXEXTENT) xy[0] = -MAXEXTENT; | ||
if (xy[1] > MAXEXTENT) xy[1] = MAXEXTENT; | ||
if (xy[1] < -MAXEXTENT) xy[1] = -MAXEXTENT; | ||
@@ -117,0 +117,0 @@ return xy; |
{ | ||
"name": "@turf/projection", | ||
"version": "5.1.0", | ||
"version": "5.1.5", | ||
"description": "turf projection 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", | ||
@@ -52,3 +53,3 @@ "docs": "node ../../scripts/generate-readmes" | ||
"@std/esm": "*", | ||
"@turf/truncate": "^5.1.0", | ||
"@turf/truncate": "^5.1.5", | ||
"benchmark": "*", | ||
@@ -58,3 +59,2 @@ "load-json-file": "*", | ||
"rollup": "*", | ||
"rollup-plugin-buble": "*", | ||
"tape": "*", | ||
@@ -64,5 +64,5 @@ "write-json-file": "*" | ||
"dependencies": { | ||
"@turf/clone": "^5.1.0", | ||
"@turf/helpers": "^5.1.0", | ||
"@turf/meta": "^5.1.0" | ||
"@turf/clone": "^5.1.5", | ||
"@turf/helpers": "^5.1.5", | ||
"@turf/meta": "^5.1.5" | ||
}, | ||
@@ -69,0 +69,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
18539
8
Updated@turf/clone@^5.1.5
Updated@turf/helpers@^5.1.5
Updated@turf/meta@^5.1.5