@turf/transform-rotate
Advanced tools
Comparing version 5.1.0 to 5.1.5
12
main.js
@@ -37,3 +37,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 pivot = options.pivot; | ||
@@ -43,13 +43,13 @@ var mutate = options.mutate; | ||
// Input validation | ||
if (!geojson) { throw new Error('geojson is required'); } | ||
if (angle === undefined || angle === null || isNaN(angle)) { throw new Error('angle is required'); } | ||
if (!geojson) throw new Error('geojson is required'); | ||
if (angle === undefined || angle === null || isNaN(angle)) throw new Error('angle is required'); | ||
// Shortcut no-rotation | ||
if (angle === 0) { return geojson; } | ||
if (angle === 0) return geojson; | ||
// Use centroid of GeoJSON if pivot is not provided | ||
if (!pivot) { pivot = centroid(geojson); } | ||
if (!pivot) pivot = centroid(geojson); | ||
// Clone geojson to avoid side effects | ||
if (mutate === false || mutate === undefined) { geojson = clone(geojson); } | ||
if (mutate === false || mutate === undefined) geojson = clone(geojson); | ||
@@ -56,0 +56,0 @@ // Rotate each coordinate |
{ | ||
"name": "@turf/transform-rotate", | ||
"version": "5.1.0", | ||
"version": "5.1.5", | ||
"description": "turf transform-rotate 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", | ||
@@ -44,7 +45,6 @@ "docs": "node ../../scripts/generate-readmes" | ||
"@std/esm": "*", | ||
"@turf/truncate": "^5.1.0", | ||
"@turf/truncate": "^5.1.5", | ||
"benchmark": "*", | ||
"load-json-file": "*", | ||
"rollup": "*", | ||
"rollup-plugin-buble": "*", | ||
"tape": "*", | ||
@@ -54,10 +54,10 @@ "write-json-file": "*" | ||
"dependencies": { | ||
"@turf/centroid": "^5.1.0", | ||
"@turf/clone": "^5.1.0", | ||
"@turf/helpers": "^5.1.0", | ||
"@turf/invariant": "^5.1.0", | ||
"@turf/meta": "^5.1.0", | ||
"@turf/rhumb-bearing": "^5.1.0", | ||
"@turf/rhumb-destination": "^5.1.0", | ||
"@turf/rhumb-distance": "^5.1.0" | ||
"@turf/centroid": "^5.1.5", | ||
"@turf/clone": "^5.1.5", | ||
"@turf/helpers": "^5.1.5", | ||
"@turf/invariant": "^5.1.5", | ||
"@turf/meta": "^5.1.5", | ||
"@turf/rhumb-bearing": "^5.1.5", | ||
"@turf/rhumb-destination": "^5.1.5", | ||
"@turf/rhumb-distance": "^5.1.5" | ||
}, | ||
@@ -64,0 +64,0 @@ "@std/esm": { |
13075
7
Updated@turf/centroid@^5.1.5
Updated@turf/clone@^5.1.5
Updated@turf/helpers@^5.1.5
Updated@turf/invariant@^5.1.5
Updated@turf/meta@^5.1.5
Updated@turf/rhumb-bearing@^5.1.5
Updated@turf/rhumb-distance@^5.1.5