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

@turf/center-mean

Package Overview
Dependencies
Maintainers
4
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@turf/center-mean - npm Package Compare versions

Comparing version 5.0.0 to 5.0.1

15

main.js

@@ -47,11 +47,10 @@ 'use strict';

weightValue = Number(weightValue);
if (weightValue < 0) throw new Error('weight value must be positive for feature index ' + featureIndex);
meta.coordEach(geom, function (coord) {
sumXs += coord[0] * weightValue;
sumYs += coord[1] * weightValue;
sumNs += weightValue;
});
if (weightValue > 0) {
meta.coordEach(geom, function (coord) {
sumXs += coord[0] * weightValue;
sumYs += coord[1] * weightValue;
sumNs += weightValue;
});
}
});
// if (sumNs) sumNs = 1;
if (sumNs === 0) throw new Error('sum of weights equals zero');
return helpers.point([sumXs / sumNs, sumYs / sumNs], properties);

@@ -58,0 +57,0 @@ }

{
"name": "@turf/center-mean",
"version": "5.0.0",
"version": "5.0.1",
"description": "turf center-mean module",

@@ -5,0 +5,0 @@ "main": "main",

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