@turf/transform-rotate
Advanced tools
Comparing version 6.4.0 to 6.5.0
'use strict'; | ||
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } | ||
var centroid = _interopDefault(require('@turf/centroid')); | ||
var rhumbBearing = _interopDefault(require('@turf/rhumb-bearing')); | ||
var rhumbDistance = _interopDefault(require('@turf/rhumb-distance')); | ||
var rhumbDestination = _interopDefault(require('@turf/rhumb-destination')); | ||
var clone = _interopDefault(require('@turf/clone')); | ||
var centroid = require('@turf/centroid'); | ||
var rhumbBearing = require('@turf/rhumb-bearing'); | ||
var rhumbDistance = require('@turf/rhumb-distance'); | ||
var rhumbDestination = require('@turf/rhumb-destination'); | ||
var clone = require('@turf/clone'); | ||
var meta = require('@turf/meta'); | ||
@@ -14,2 +12,10 @@ var invariant = require('@turf/invariant'); | ||
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } | ||
var centroid__default = /*#__PURE__*/_interopDefaultLegacy(centroid); | ||
var rhumbBearing__default = /*#__PURE__*/_interopDefaultLegacy(rhumbBearing); | ||
var rhumbDistance__default = /*#__PURE__*/_interopDefaultLegacy(rhumbDistance); | ||
var rhumbDestination__default = /*#__PURE__*/_interopDefaultLegacy(rhumbDestination); | ||
var clone__default = /*#__PURE__*/_interopDefaultLegacy(clone); | ||
/** | ||
@@ -50,13 +56,13 @@ * Rotates any geojson Feature or Geometry of a specified angle, around its `centroid` or a given `pivot` point. | ||
// Use centroid of GeoJSON if pivot is not provided | ||
if (!pivot) pivot = centroid(geojson); | ||
if (!pivot) pivot = centroid__default['default'](geojson); | ||
// Clone geojson to avoid side effects | ||
if (mutate === false || mutate === undefined) geojson = clone(geojson); | ||
if (mutate === false || mutate === undefined) geojson = clone__default['default'](geojson); | ||
// Rotate each coordinate | ||
meta.coordEach(geojson, function (pointCoords) { | ||
var initialAngle = rhumbBearing(pivot, pointCoords); | ||
var initialAngle = rhumbBearing__default['default'](pivot, pointCoords); | ||
var finalAngle = initialAngle + angle; | ||
var distance = rhumbDistance(pivot, pointCoords); | ||
var newCoords = invariant.getCoords(rhumbDestination(pivot, distance, finalAngle)); | ||
var distance = rhumbDistance__default['default'](pivot, pointCoords); | ||
var newCoords = invariant.getCoords(rhumbDestination__default['default'](pivot, distance, finalAngle)); | ||
pointCoords[0] = newCoords[0]; | ||
@@ -69,1 +75,2 @@ pointCoords[1] = newCoords[1]; | ||
module.exports = transformRotate; | ||
module.exports.default = transformRotate; |
{ | ||
"name": "@turf/transform-rotate", | ||
"version": "6.4.0", | ||
"version": "6.5.0", | ||
"description": "turf transform-rotate module", | ||
@@ -19,2 +19,3 @@ "author": "Turf Authors", | ||
}, | ||
"funding": "https://opencollective.com/turf", | ||
"publishConfig": { | ||
@@ -53,3 +54,3 @@ "access": "public" | ||
"devDependencies": { | ||
"@turf/truncate": "^6.4.0", | ||
"@turf/truncate": "^6.5.0", | ||
"benchmark": "*", | ||
@@ -63,12 +64,12 @@ "load-json-file": "*", | ||
"dependencies": { | ||
"@turf/centroid": "^6.4.0", | ||
"@turf/clone": "^6.4.0", | ||
"@turf/helpers": "^6.4.0", | ||
"@turf/invariant": "^6.4.0", | ||
"@turf/meta": "^6.4.0", | ||
"@turf/rhumb-bearing": "^6.4.0", | ||
"@turf/rhumb-destination": "^6.4.0", | ||
"@turf/rhumb-distance": "^6.4.0" | ||
"@turf/centroid": "^6.5.0", | ||
"@turf/clone": "^6.5.0", | ||
"@turf/helpers": "^6.5.0", | ||
"@turf/invariant": "^6.5.0", | ||
"@turf/meta": "^6.5.0", | ||
"@turf/rhumb-bearing": "^6.5.0", | ||
"@turf/rhumb-destination": "^6.5.0", | ||
"@turf/rhumb-distance": "^6.5.0" | ||
}, | ||
"gitHead": "1e62773cfc88c627cca8effcb5c14cfb65a905ac" | ||
"gitHead": "5375941072b90d489389db22b43bfe809d5e451e" | ||
} |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
10911
130
0
Updated@turf/centroid@^6.5.0
Updated@turf/clone@^6.5.0
Updated@turf/helpers@^6.5.0
Updated@turf/invariant@^6.5.0
Updated@turf/meta@^6.5.0
Updated@turf/rhumb-bearing@^6.5.0
Updated@turf/rhumb-distance@^6.5.0