@turf/centroid 6.2.0-alpha.1 → 6.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/index.js +3 -3
- package/dist/es/package.json +1 -0
- package/dist/js/index.d.ts +1 -1
- package/dist/js/index.js +1 -1
- package/package.json +20 -12
package/dist/es/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { coordEach } from
|
|
2
|
-
import { point } from
|
|
1
|
+
import { coordEach } from "@turf/meta";
|
|
2
|
+
import { point } from "@turf/helpers";
|
|
3
3
|
/**
|
|
4
4
|
* Takes one or more features and calculates the centroid using the mean of all vertices.
|
|
5
5
|
* This lessens the effect of small islands and artifacts when calculating the centroid of a set of polygons.
|
|
@@ -26,7 +26,7 @@ function centroid(geojson, options) {
|
|
|
26
26
|
xSum += coord[0];
|
|
27
27
|
ySum += coord[1];
|
|
28
28
|
len++;
|
|
29
|
-
});
|
|
29
|
+
}, true);
|
|
30
30
|
return point([xSum / len, ySum / len], options.properties);
|
|
31
31
|
}
|
|
32
32
|
export default centroid;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"module"}
|
package/dist/js/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AllGeoJSON, Feature, Point, Properties } from
|
|
1
|
+
import { AllGeoJSON, Feature, Point, Properties } from "@turf/helpers";
|
|
2
2
|
/**
|
|
3
3
|
* Takes one or more features and calculates the centroid using the mean of all vertices.
|
|
4
4
|
* This lessens the effect of small islands and artifacts when calculating the centroid of a set of polygons.
|
package/dist/js/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@turf/centroid",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.3.0",
|
|
4
4
|
"description": "turf centroid module",
|
|
5
5
|
"author": "Turf Authors",
|
|
6
6
|
"license": "MIT",
|
|
@@ -23,21 +23,27 @@
|
|
|
23
23
|
],
|
|
24
24
|
"main": "dist/js/index.js",
|
|
25
25
|
"module": "dist/es/index.js",
|
|
26
|
+
"exports": {
|
|
27
|
+
"./package.json": "./package.json",
|
|
28
|
+
".": {
|
|
29
|
+
"import": "./dist/es/index.js",
|
|
30
|
+
"require": "./dist/js/index.js"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
26
33
|
"types": "dist/js/index.d.ts",
|
|
27
34
|
"sideEffects": false,
|
|
28
35
|
"files": [
|
|
29
36
|
"dist"
|
|
30
37
|
],
|
|
31
38
|
"scripts": {
|
|
32
|
-
"bench": "
|
|
33
|
-
"
|
|
39
|
+
"bench": "ts-node bench.js",
|
|
40
|
+
"build": "npm-run-all build:*",
|
|
41
|
+
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
|
|
42
|
+
"build:js": "tsc",
|
|
34
43
|
"docs": "node ../../scripts/generate-readmes",
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"test": "npm-run-all prepare test:*",
|
|
39
|
-
"test:tape": "node -r esm test.js",
|
|
40
|
-
"test:types": "tsc --noEmit types.ts"
|
|
44
|
+
"test": "npm-run-all test:*",
|
|
45
|
+
"test:tape": "ts-node -r esm test.js",
|
|
46
|
+
"test:types": "tsc --esModuleInterop --noEmit types.ts"
|
|
41
47
|
},
|
|
42
48
|
"devDependencies": {
|
|
43
49
|
"@types/tape": "*",
|
|
@@ -45,14 +51,16 @@
|
|
|
45
51
|
"geojson-fixtures": "*",
|
|
46
52
|
"glob": "*",
|
|
47
53
|
"load-json-file": "*",
|
|
54
|
+
"npm-run-all": "*",
|
|
48
55
|
"tape": "*",
|
|
56
|
+
"ts-node": "*",
|
|
49
57
|
"tslint": "*",
|
|
50
58
|
"typescript": "*",
|
|
51
59
|
"write-json-file": "*"
|
|
52
60
|
},
|
|
53
61
|
"dependencies": {
|
|
54
|
-
"@turf/helpers": "^6.
|
|
55
|
-
"@turf/meta": "^6.
|
|
62
|
+
"@turf/helpers": "^6.3.0",
|
|
63
|
+
"@turf/meta": "^6.3.0"
|
|
56
64
|
},
|
|
57
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "57c8877e1e2d67effc2cdd23385c02b2a6615a49"
|
|
58
66
|
}
|