Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@turf/centroid

Package Overview
Dependencies
Maintainers
4
Versions
61
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@turf/centroid - npm Package Compare versions

Comparing version 5.1.5 to 6.0.0

index.ts

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"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc