@turf/centroid
Advanced tools
Comparing version 5.1.5 to 6.0.0
16
index.js
@@ -1,4 +0,5 @@ | ||
import { coordEach } from '@turf/meta'; | ||
import { point } from '@turf/helpers'; | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var meta_1 = require("@turf/meta"); | ||
var helpers_1 = require("@turf/helpers"); | ||
/** | ||
@@ -24,10 +25,9 @@ * Takes one or more features and calculates the centroid using the mean of all vertices. | ||
var len = 0; | ||
coordEach(geojson, function (coord) { | ||
meta_1.coordEach(geojson, function (coord) { | ||
xSum += coord[0]; | ||
ySum += coord[1]; | ||
len++; | ||
}, true); | ||
return point([xSum / len, ySum / len], properties); | ||
}); | ||
return helpers_1.point([xSum / len, ySum / len], properties); | ||
} | ||
export default centroid; | ||
exports.default = centroid; |
{ | ||
"name": "@turf/centroid", | ||
"version": "5.1.5", | ||
"version": "6.0.0", | ||
"description": "turf centroid module", | ||
"main": "main.js", | ||
"module": "main.es.js", | ||
"types": "index.d.ts", | ||
"main": "index", | ||
"files": [ | ||
"index.js", | ||
"index.d.ts", | ||
"main.js", | ||
"main.es.js" | ||
"index.ts" | ||
], | ||
"scripts": { | ||
"pretest": "rollup -c ../../rollup.config.js", | ||
"test": "node -r @std/esm test.js", | ||
"posttest": "node -r @std/esm ../../scripts/validate-es5-dependencies.js", | ||
"bench": "node -r @std/esm bench.js", | ||
"prepare": "tsc", | ||
"pretest": "tsc", | ||
"test": "node test.js", | ||
"bench": "node bench.js", | ||
"docs": "node ../../scripts/generate-readmes" | ||
@@ -38,3 +34,2 @@ }, | ||
"devDependencies": { | ||
"@std/esm": "*", | ||
"benchmark": "*", | ||
@@ -44,3 +39,3 @@ "geojson-fixtures": "*", | ||
"load-json-file": "*", | ||
"rollup": "*", | ||
"typescript": "*", | ||
"tape": "*", | ||
@@ -50,9 +45,5 @@ "write-json-file": "*" | ||
"dependencies": { | ||
"@turf/helpers": "^5.1.5", | ||
"@turf/meta": "^5.1.5" | ||
}, | ||
"@std/esm": { | ||
"esm": "js", | ||
"cjs": true | ||
"@turf/helpers": "6.x", | ||
"@turf/meta": "6.x" | ||
} | ||
} |
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
7
5924
5
62
+ Added@turf/helpers@6.5.0(transitive)
+ Added@turf/meta@6.5.0(transitive)
- Removed@turf/helpers@5.1.5(transitive)
- Removed@turf/meta@5.2.0(transitive)
Updated@turf/helpers@6.x
Updated@turf/meta@6.x