diff --git a/.eslintrc.js b/.eslintrc.js
index 7392ad799..777f75358 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -14,12 +14,12 @@ const rules = {
module.exports = {
root: true,
ignorePatterns: ["**/dist/**"],
+ parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint"],
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
- "prettier",
- "prettier/@typescript-eslint",
+ "plugin:prettier/recommended",
],
parserOptions: {
ecmaVersion: 6,
diff --git a/.github/workflows/turf.yml b/.github/workflows/turf.yml
index 117eb2852..05ecb6c2b 100644
--- a/.github/workflows/turf.yml
+++ b/.github/workflows/turf.yml
@@ -15,28 +15,15 @@ jobs:
strategy:
matrix:
- node-version: [14.x, 16.x, 18.x, 20.x]
+ node-version: [16.x, 18.x, 20.x]
steps:
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
- uses: actions/setup-node@v1
+ uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
-
- # figure out the yarn cache directory
- - name: Get yarn cache directory path
- id: yarn-cache-dir-path
- run: echo "::set-output name=dir::$(yarn cache dir)"
-
- # cache the yarn data to speed up builds
- - uses: actions/cache@v2
- id: yarn-cache
- with:
- path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
- key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
- restore-keys: |
- ${{ runner.os }}-yarn-
+ cache: "yarn"
- run: yarn --frozen-lockfile
- run: git diff --exit-code
diff --git a/.monorepolint.config.ts b/.monorepolint.config.ts
index 7946c8556..5dd9d11a7 100644
--- a/.monorepolint.config.ts
+++ b/.monorepolint.config.ts
@@ -113,14 +113,6 @@ module.exports = {
publishConfig: {
access: "public",
},
- exports: {
- "./package.json": "./package.json",
- ".": {
- types: "./index.d.ts",
- import: "./dist/es/index.js",
- require: "./dist/js/index.js",
- },
- },
},
},
includePackages: [...TS_PACKAGES, ...JS_PACKAGES],
@@ -130,6 +122,14 @@ module.exports = {
entries: {
types: "dist/js/index.d.ts",
files: ["dist"],
+ exports: {
+ "./package.json": "./package.json",
+ ".": {
+ types: "./dist/js/index.d.ts",
+ import: "./dist/es/index.js",
+ require: "./dist/js/index.js",
+ },
+ },
},
},
includePackages: TS_PACKAGES,
@@ -139,6 +139,14 @@ module.exports = {
entries: {
types: "index.d.ts",
files: ["dist", "index.d.ts"],
+ exports: {
+ "./package.json": "./package.json",
+ ".": {
+ types: "./index.d.ts",
+ import: "./dist/es/index.js",
+ require: "./dist/js/index.js",
+ },
+ },
},
},
includePackages: JS_PACKAGES,
@@ -156,8 +164,8 @@ module.exports = {
{
options: {
scripts: {
- docs: "node ../../scripts/generate-readmes",
- test: "npm-run-all test:*",
+ docs: "tsx ../../scripts/generate-readmes",
+ test: "npm-run-all --npm-path npm test:*",
},
},
excludePackages: [MAIN_PACKAGE],
@@ -165,7 +173,7 @@ module.exports = {
{
options: {
scripts: {
- build: "npm-run-all build:*",
+ build: "npm-run-all --npm-path npm build:*",
"build:js": "tsc",
"build:es":
'tsc --outDir dist/es --module esnext --declaration false && echo \'{"type":"module"}\' > dist/es/package.json',
@@ -194,7 +202,7 @@ module.exports = {
{
options: {
scripts: {
- "test:tape": "node -r esm test.js",
+ "test:tape": "tsx test.js",
},
},
includePackages: JS_TAPE_PACKAGES,
@@ -202,7 +210,7 @@ module.exports = {
{
options: {
scripts: {
- "test:tape": "ts-node -r esm test.js",
+ "test:tape": "tsx test.js",
},
},
includePackages: TS_TAPE_PACKAGES,
@@ -210,7 +218,7 @@ module.exports = {
{
options: {
scripts: {
- bench: "node -r esm bench.js",
+ bench: "tsx bench.js",
},
},
includePackages: JS_TAPE_PACKAGES,
@@ -218,7 +226,7 @@ module.exports = {
{
options: {
scripts: {
- bench: "ts-node bench.js",
+ bench: "tsx bench.js",
},
},
includePackages: TS_TAPE_PACKAGES,
@@ -252,7 +260,7 @@ module.exports = {
tslib: "^2.3.0",
},
devDependencies: {
- "ts-node": "*",
+ tsx: "*",
typescript: "*",
},
},
@@ -262,6 +270,7 @@ module.exports = {
options: {
devDependencies: {
rollup: "*",
+ tsx: "*",
},
},
includePackages: JS_PACKAGES,
diff --git a/.prettierignore b/.prettierignore
index 150f3a1ca..d61eb9d6e 100644
--- a/.prettierignore
+++ b/.prettierignore
@@ -10,3 +10,10 @@ packages/turf-directional-mean/test/in/bus_route_utm.json
# is actually output
packages/turf/turf.min.js
+
+# Ignore test fixture json in case intentional line breaks help with coord
+# readability.
+packages/turf-*/test/in/**
+packages/turf-*/test/out/**
+packages/turf-*/test/true/**
+packages/turf-*/test/false/**
diff --git a/.prettierrc.json b/.prettierrc.json
index 0967ef424..757fd64ca 100644
--- a/.prettierrc.json
+++ b/.prettierrc.json
@@ -1 +1,3 @@
-{}
+{
+ "trailingComma": "es5"
+}
diff --git a/CHANGELOG.md b/CHANGELOG.md
index f4f4ce292..f96cbe32d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,7 @@ We intend to keep making breaking changes before 7.0.0 is fully released. If you
- Move distribution JS to target ES2017 (#2237)
- [`@turf/helpers`](helpers) Correct the conversion factor for degrees (#2177)
- [`@turf/helpers`](helpers) polygon() will now throw if the first and last coordinates are not the same (#2173)
+- [`@turf/helpers`](helpers) Separate AreaUnits into its own type (#2393)
- [`@turf/area`](area) Fix earth radius to use WGS84 median earth radius (#2166)
- [`@turf/turf`](turf) Remove re-exports for turf 4.x compatability (#2183)
- [`@turf/rectangle-grid`](rectangle-grid) Fix correctness for large areas (#2106)
@@ -22,6 +23,7 @@ We intend to keep making breaking changes before 7.0.0 is fully released. If you
- [`@turf/boolean-point-in-polygon`](boolean-point-in-polygon) Move to point-in-polygon-hao library for performance and correctness (#1893)
- [`@turf/line-intersect`][line-intersect] Move to sweepline-intersections library for performance (#2033)
- [`@turf/boolean-contains`](boolean-contains) Add multipolygon support (#2338)
+- [`@turf/nearest-point`](nearest-point) Add unit option (#2415)
## 🐛 Bug Fixes
- [`@turf/polygon-smooth`](polygon-smooth) Options argument is now actually optional (#2149)
@@ -42,6 +44,9 @@ We intend to keep making breaking changes before 7.0.0 is fully released. If you
- [`@turf/boolean-within`](boolean-within) Fix multipoint checks (#2216)
- [`@turf/points-within-polygon`](points-within-polygon) Fix dropped properties on MultiPoint results (#2227)
- [`@turf/random`](random) Throws error on invalid bbox inputs (#2172)
+- [`@turf/boolean-parallel`](boolean-parallel) Lines with 180 degree angle between them are also considered parallel (#2475)
+- [`@turf/unkink-polygon`](unkink-polygon) Fix a maximum call stack size exceeded error with very large polygons (#2504)
+- [`@turf/line-arc`](line-arc) Number of arc segments generated wasn't related to steps value passed in (#2524)
## 📖 Documentation
- [`@turf/bbox`][bbox] Improve documentation (#2153)
@@ -52,6 +57,9 @@ We intend to keep making breaking changes before 7.0.0 is fully released. If you
- [`@turf/buffer`](buffer) Clean up Typescript types (#2188)
- [`@turf/polygon-smooth`](polygon-smooth) Clean up a typo (#2293)
- [`@turf/nearest-point-on-line`](nearest-point-on-line) Clean up typescript types (#2296)
+- [`@turf/boolean-touches`](boolean-touches) Add boolean-touches to docs (#2431)
+- [`@turf/boolean-equals`](boolean-equals) Improve docs (#2412)
+
- Remove Bower references (#2146)
- Fix typo in README (#2313)
- Lots of cleanup for CONTRIBUTING, README, and RELEASING (#2186)
@@ -63,6 +71,7 @@ We intend to keep making breaking changes before 7.0.0 is fully released. If you
- [`@turf/turf](turf) Add booleanTouches export (#2170)
- [`@turf/turf](turf) Add booleanConcave export (#2265)
- [`@turf/helpers](helpers) Make isObject a little more accurate (#2176)
+- Add custom types entry point to exports, required by Typescript for node16, nodenext and bundler module resolution strategies (#2400, #2452)
- types.ts tests are now run in strict mode (#2363)
- Uses tslib now for smaller bundles (#2165)
- Remove object-assign dependency from all packages (#2241)
diff --git a/documentation.yml b/documentation.yml
index b5efb85ae..671d6b572 100644
--- a/documentation.yml
+++ b/documentation.yml
@@ -143,6 +143,7 @@ toc:
- booleanParallel
- booleanPointInPolygon
- booleanPointOnLine
+ - booleanTouches
- booleanWithin
- name: Unit Conversion
- bearingToAzimuth
diff --git a/examples/browser/index.html b/examples/browser/index.html
index abdf1f475..aaf1f88a1 100644
--- a/examples/browser/index.html
+++ b/examples/browser/index.html
@@ -1,4 +1,4 @@
-
+
| G, bbox: BBox) {
const geom = getGeom(feature);
const type = geom.type;
diff --git a/packages/turf-bbox-clip/package.json b/packages/turf-bbox-clip/package.json
index 951e198bf..24c331aa1 100644
--- a/packages/turf-bbox-clip/package.json
+++ b/packages/turf-bbox-clip/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/bbox-clip",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf bbox-clip module",
"author": "Turf Authors",
"contributors": [
@@ -33,7 +33,7 @@
"exports": {
"./package.json": "./package.json",
".": {
- "types": "./index.d.ts",
+ "types": "./dist/js/index.d.ts",
"import": "./dist/es/index.js",
"require": "./dist/js/index.js"
}
@@ -44,29 +44,28 @@
"dist"
],
"scripts": {
- "bench": "ts-node bench.js",
- "build": "npm-run-all build:*",
+ "bench": "tsx bench.js",
+ "build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "ts-node -r esm test.js"
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js"
},
"devDependencies": {
- "@turf/bbox": "^7.0.0-alpha.0",
+ "@turf/bbox": "^7.0.0-alpha.2",
"@types/tape": "*",
"benchmark": "*",
"load-json-file": "*",
"npm-run-all": "*",
"tape": "*",
- "ts-node": "*",
- "tslint": "*",
+ "tsx": "*",
"typescript": "*",
"write-json-file": "*"
},
"dependencies": {
- "@turf/helpers": "^7.0.0-alpha.0",
- "@turf/invariant": "^7.0.0-alpha.0",
+ "@turf/helpers": "^7.0.0-alpha.2",
+ "@turf/invariant": "^7.0.0-alpha.2",
"tslib": "^2.3.0"
}
}
diff --git a/packages/turf-bbox-polygon/index.ts b/packages/turf-bbox-polygon/index.ts
index 8d1e1ae91..0dabe181c 100644
--- a/packages/turf-bbox-polygon/index.ts
+++ b/packages/turf-bbox-polygon/index.ts
@@ -18,7 +18,9 @@ import { polygon, Id } from "@turf/helpers";
* //addToMap
* var addToMap = [poly]
*/
-export default function bboxPolygon(
+export default function bboxPolygon<
+ P extends GeoJsonProperties = GeoJsonProperties,
+>(
bbox: BBox,
options: {
properties?: P;
diff --git a/packages/turf-bbox-polygon/package.json b/packages/turf-bbox-polygon/package.json
index 4db0691fd..c45b5b118 100644
--- a/packages/turf-bbox-polygon/package.json
+++ b/packages/turf-bbox-polygon/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/bbox-polygon",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf bbox-polygon module",
"author": "Turf Authors",
"license": "MIT",
@@ -28,7 +28,7 @@
"exports": {
"./package.json": "./package.json",
".": {
- "types": "./index.d.ts",
+ "types": "./dist/js/index.d.ts",
"import": "./dist/es/index.js",
"require": "./dist/js/index.js"
}
@@ -39,25 +39,24 @@
"dist"
],
"scripts": {
- "bench": "ts-node bench.js",
- "build": "npm-run-all build:*",
+ "bench": "tsx bench.js",
+ "build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "ts-node -r esm test.js"
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js"
},
"devDependencies": {
"@types/tape": "*",
"benchmark": "*",
"npm-run-all": "*",
"tape": "*",
- "ts-node": "*",
- "tslint": "*",
+ "tsx": "*",
"typescript": "*"
},
"dependencies": {
- "@turf/helpers": "^7.0.0-alpha.0",
+ "@turf/helpers": "^7.0.0-alpha.2",
"tslib": "^2.3.0"
}
}
diff --git a/packages/turf-bbox/package.json b/packages/turf-bbox/package.json
index 162c4cd63..a83224a55 100644
--- a/packages/turf-bbox/package.json
+++ b/packages/turf-bbox/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/bbox",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf bbox module",
"author": "Turf Authors",
"license": "MIT",
@@ -29,7 +29,7 @@
"exports": {
"./package.json": "./package.json",
".": {
- "types": "./index.d.ts",
+ "types": "./dist/js/index.d.ts",
"import": "./dist/es/index.js",
"require": "./dist/js/index.js"
}
@@ -40,26 +40,25 @@
"dist"
],
"scripts": {
- "bench": "ts-node bench.js",
- "build": "npm-run-all build:*",
+ "bench": "tsx bench.js",
+ "build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "ts-node -r esm test.js"
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js"
},
"devDependencies": {
"@types/tape": "*",
"benchmark": "*",
"npm-run-all": "*",
"tape": "*",
- "ts-node": "*",
- "tslint": "*",
+ "tsx": "*",
"typescript": "*"
},
"dependencies": {
- "@turf/helpers": "^7.0.0-alpha.0",
- "@turf/meta": "^7.0.0-alpha.0",
+ "@turf/helpers": "^7.0.0-alpha.2",
+ "@turf/meta": "^7.0.0-alpha.2",
"tslib": "^2.3.0"
}
}
diff --git a/packages/turf-bearing/package.json b/packages/turf-bearing/package.json
index 0d9586764..c853a01ed 100644
--- a/packages/turf-bearing/package.json
+++ b/packages/turf-bearing/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/bearing",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf bearing module",
"author": "Turf Authors",
"license": "MIT",
@@ -25,7 +25,7 @@
"exports": {
"./package.json": "./package.json",
".": {
- "types": "./index.d.ts",
+ "types": "./dist/js/index.d.ts",
"import": "./dist/es/index.js",
"require": "./dist/js/index.js"
}
@@ -36,28 +36,27 @@
"dist"
],
"scripts": {
- "bench": "ts-node bench.js",
- "build": "npm-run-all build:*",
+ "bench": "tsx bench.js",
+ "build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "ts-node -r esm test.js"
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js"
},
"devDependencies": {
- "@turf/destination": "^7.0.0-alpha.0",
+ "@turf/destination": "^7.0.0-alpha.2",
"@types/tape": "*",
"benchmark": "*",
"npm-run-all": "*",
"tape": "*",
- "ts-node": "*",
- "tslint": "*",
+ "tsx": "*",
"typescript": "*",
"write-json-file": "*"
},
"dependencies": {
- "@turf/helpers": "^7.0.0-alpha.0",
- "@turf/invariant": "^7.0.0-alpha.0",
+ "@turf/helpers": "^7.0.0-alpha.2",
+ "@turf/invariant": "^7.0.0-alpha.2",
"tslib": "^2.3.0"
}
}
diff --git a/packages/turf-bezier-spline/index.ts b/packages/turf-bezier-spline/index.ts
index a23c8bd7f..86d0f4fbe 100644
--- a/packages/turf-bezier-spline/index.ts
+++ b/packages/turf-bezier-spline/index.ts
@@ -33,7 +33,7 @@ import Spline from "./lib/spline";
* var addToMap = [line, curved]
* curved.properties = { stroke: '#0F0' };
*/
-function bezier
(
+function bezier
(
line: Feature | LineString,
options: {
properties?: P;
diff --git a/packages/turf-bezier-spline/package.json b/packages/turf-bezier-spline/package.json
index 658de7026..06bde86b9 100644
--- a/packages/turf-bezier-spline/package.json
+++ b/packages/turf-bezier-spline/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/bezier-spline",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf bezier-spline module",
"author": "Turf Authors",
"license": "MIT",
@@ -28,7 +28,7 @@
"exports": {
"./package.json": "./package.json",
".": {
- "types": "./index.d.ts",
+ "types": "./dist/js/index.d.ts",
"import": "./dist/es/index.js",
"require": "./dist/js/index.js"
}
@@ -39,13 +39,13 @@
"dist"
],
"scripts": {
- "bench": "ts-node bench.js",
- "build": "npm-run-all build:*",
+ "bench": "tsx bench.js",
+ "build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "ts-node -r esm test.js"
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js"
},
"devDependencies": {
"@types/tape": "*",
@@ -53,14 +53,13 @@
"load-json-file": "*",
"npm-run-all": "*",
"tape": "*",
- "ts-node": "*",
- "tslint": "*",
+ "tsx": "*",
"typescript": "*",
"write-json-file": "*"
},
"dependencies": {
- "@turf/helpers": "^7.0.0-alpha.0",
- "@turf/invariant": "^7.0.0-alpha.0",
+ "@turf/helpers": "^7.0.0-alpha.2",
+ "@turf/invariant": "^7.0.0-alpha.2",
"tslib": "^2.3.0"
}
}
diff --git a/packages/turf-boolean-clockwise/package.json b/packages/turf-boolean-clockwise/package.json
index 410f43f45..9b6587b2a 100755
--- a/packages/turf-boolean-clockwise/package.json
+++ b/packages/turf-boolean-clockwise/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/boolean-clockwise",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf boolean-clockwise module",
"author": "Turf Authors",
"contributors": [
@@ -32,7 +32,7 @@
"exports": {
"./package.json": "./package.json",
".": {
- "types": "./index.d.ts",
+ "types": "./dist/js/index.d.ts",
"import": "./dist/es/index.js",
"require": "./dist/js/index.js"
}
@@ -43,13 +43,13 @@
"dist"
],
"scripts": {
- "bench": "ts-node bench.js",
- "build": "npm-run-all build:*",
+ "bench": "tsx bench.js",
+ "build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "ts-node -r esm test.js"
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js"
},
"devDependencies": {
"@types/tape": "*",
@@ -58,13 +58,12 @@
"load-json-file": "*",
"npm-run-all": "*",
"tape": "*",
- "ts-node": "*",
- "tslint": "*",
+ "tsx": "*",
"typescript": "*"
},
"dependencies": {
- "@turf/helpers": "^7.0.0-alpha.0",
- "@turf/invariant": "^7.0.0-alpha.0",
+ "@turf/helpers": "^7.0.0-alpha.2",
+ "@turf/invariant": "^7.0.0-alpha.2",
"tslib": "^2.3.0"
}
}
diff --git a/packages/turf-boolean-concave/package.json b/packages/turf-boolean-concave/package.json
index 25f043749..a05ec9f50 100644
--- a/packages/turf-boolean-concave/package.json
+++ b/packages/turf-boolean-concave/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/boolean-concave",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf boolean-concave module",
"author": "Turf Authors",
"contributors": [
@@ -31,7 +31,7 @@
"exports": {
"./package.json": "./package.json",
".": {
- "types": "./index.d.ts",
+ "types": "./dist/js/index.d.ts",
"import": "./dist/es/index.js",
"require": "./dist/js/index.js"
}
@@ -42,13 +42,13 @@
"dist"
],
"scripts": {
- "bench": "ts-node bench.js",
- "build": "npm-run-all build:*",
+ "bench": "tsx bench.js",
+ "build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "ts-node -r esm test.js"
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js"
},
"devDependencies": {
"@types/tape": "*",
@@ -57,13 +57,12 @@
"load-json-file": "*",
"npm-run-all": "*",
"tape": "*",
- "ts-node": "*",
- "tslint": "*",
+ "tsx": "*",
"typescript": "*"
},
"dependencies": {
- "@turf/helpers": "^7.0.0-alpha.0",
- "@turf/invariant": "^7.0.0-alpha.0",
+ "@turf/helpers": "^7.0.0-alpha.2",
+ "@turf/invariant": "^7.0.0-alpha.2",
"tslib": "^2.3.0"
}
}
diff --git a/packages/turf-boolean-contains/package.json b/packages/turf-boolean-contains/package.json
index fa4b87a43..903031820 100644
--- a/packages/turf-boolean-contains/package.json
+++ b/packages/turf-boolean-contains/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/boolean-contains",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf boolean-contains module",
"author": "Turf Authors",
"contributors": [
@@ -31,7 +31,7 @@
"exports": {
"./package.json": "./package.json",
".": {
- "types": "./index.d.ts",
+ "types": "./dist/js/index.d.ts",
"import": "./dist/es/index.js",
"require": "./dist/js/index.js"
}
@@ -42,13 +42,13 @@
"dist"
],
"scripts": {
- "bench": "ts-node bench.js",
- "build": "npm-run-all build:*",
+ "bench": "tsx bench.js",
+ "build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "ts-node -r esm test.js"
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js"
},
"devDependencies": {
"@types/tape": "*",
@@ -59,16 +59,15 @@
"load-json-file": "*",
"npm-run-all": "*",
"tape": "*",
- "ts-node": "*",
- "tslint": "*",
+ "tsx": "*",
"typescript": "*"
},
"dependencies": {
- "@turf/bbox": "^7.0.0-alpha.0",
- "@turf/boolean-point-in-polygon": "^7.0.0-alpha.0",
- "@turf/boolean-point-on-line": "^7.0.0-alpha.0",
- "@turf/helpers": "^7.0.0-alpha.0",
- "@turf/invariant": "^7.0.0-alpha.0",
+ "@turf/bbox": "^7.0.0-alpha.2",
+ "@turf/boolean-point-in-polygon": "^7.0.0-alpha.2",
+ "@turf/boolean-point-on-line": "^7.0.0-alpha.2",
+ "@turf/helpers": "^7.0.0-alpha.2",
+ "@turf/invariant": "^7.0.0-alpha.2",
"tslib": "^2.3.0"
}
}
diff --git a/packages/turf-boolean-crosses/package.json b/packages/turf-boolean-crosses/package.json
index bef056fc1..fdd3fca33 100644
--- a/packages/turf-boolean-crosses/package.json
+++ b/packages/turf-boolean-crosses/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/boolean-crosses",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf boolean-crosses module",
"author": "Turf Authors",
"contributors": [
@@ -31,7 +31,7 @@
"exports": {
"./package.json": "./package.json",
".": {
- "types": "./index.d.ts",
+ "types": "./dist/js/index.d.ts",
"import": "./dist/es/index.js",
"require": "./dist/js/index.js"
}
@@ -42,13 +42,13 @@
"dist"
],
"scripts": {
- "bench": "ts-node bench.js",
- "build": "npm-run-all build:*",
+ "bench": "tsx bench.js",
+ "build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "ts-node -r esm test.js"
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js"
},
"devDependencies": {
"@types/tape": "*",
@@ -58,16 +58,15 @@
"load-json-file": "*",
"npm-run-all": "*",
"tape": "*",
- "ts-node": "*",
- "tslint": "*",
+ "tsx": "*",
"typescript": "*"
},
"dependencies": {
- "@turf/boolean-point-in-polygon": "^7.0.0-alpha.0",
- "@turf/helpers": "^7.0.0-alpha.0",
- "@turf/invariant": "^7.0.0-alpha.0",
- "@turf/line-intersect": "^7.0.0-alpha.0",
- "@turf/polygon-to-line": "^7.0.0-alpha.0",
+ "@turf/boolean-point-in-polygon": "^7.0.0-alpha.2",
+ "@turf/helpers": "^7.0.0-alpha.2",
+ "@turf/invariant": "^7.0.0-alpha.2",
+ "@turf/line-intersect": "^7.0.0-alpha.2",
+ "@turf/polygon-to-line": "^7.0.0-alpha.2",
"tslib": "^2.3.0"
}
}
diff --git a/packages/turf-boolean-disjoint/package.json b/packages/turf-boolean-disjoint/package.json
index 5d6135f82..3cf340f45 100644
--- a/packages/turf-boolean-disjoint/package.json
+++ b/packages/turf-boolean-disjoint/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/boolean-disjoint",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf boolean-disjoint module",
"author": "Turf Authors",
"contributors": [
@@ -31,7 +31,7 @@
"exports": {
"./package.json": "./package.json",
".": {
- "types": "./index.d.ts",
+ "types": "./dist/js/index.d.ts",
"import": "./dist/es/index.js",
"require": "./dist/js/index.js"
}
@@ -42,13 +42,13 @@
"dist"
],
"scripts": {
- "bench": "ts-node bench.js",
- "build": "npm-run-all build:*",
+ "bench": "tsx bench.js",
+ "build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "ts-node -r esm test.js"
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js"
},
"devDependencies": {
"@types/tape": "*",
@@ -57,16 +57,15 @@
"load-json-file": "*",
"npm-run-all": "*",
"tape": "*",
- "ts-node": "*",
- "tslint": "*",
+ "tsx": "*",
"typescript": "*"
},
"dependencies": {
- "@turf/boolean-point-in-polygon": "^7.0.0-alpha.0",
- "@turf/helpers": "^7.0.0-alpha.0",
- "@turf/line-intersect": "^7.0.0-alpha.0",
- "@turf/meta": "^7.0.0-alpha.0",
- "@turf/polygon-to-line": "^7.0.0-alpha.0",
+ "@turf/boolean-point-in-polygon": "^7.0.0-alpha.2",
+ "@turf/helpers": "^7.0.0-alpha.2",
+ "@turf/line-intersect": "^7.0.0-alpha.2",
+ "@turf/meta": "^7.0.0-alpha.2",
+ "@turf/polygon-to-line": "^7.0.0-alpha.2",
"tslib": "^2.3.0"
}
}
diff --git a/packages/turf-boolean-equal/README.md b/packages/turf-boolean-equal/README.md
index cc599dc9f..63bfab978 100644
--- a/packages/turf-boolean-equal/README.md
+++ b/packages/turf-boolean-equal/README.md
@@ -4,7 +4,7 @@
## booleanEqual
-Determine whether two geometries of the same type have identical X,Y coordinate values.
+Determines whether two geometries or features of the same type have identical X,Y coordinate values and properties.
See [http://edndoc.esri.com/arcsde/9.0/general_topics/understand_spatial_relations.htm][1]
### Parameters
@@ -21,11 +21,17 @@ See [http://edndoc.esri.com/arcsde/9.0/general_topics/understand_spatial_relatio
var pt1 = turf.point([0, 0]);
var pt2 = turf.point([0, 0]);
var pt3 = turf.point([1, 1]);
+var pt4 = turf.point([0, 0], {prop: 'A'});
+var pt5 = turf.point([0, 0], {prop: 'B'});
turf.booleanEqual(pt1, pt2);
//= true
turf.booleanEqual(pt2, pt3);
//= false
+turf.booleanEqual(pt4, pt5);
+//= false
+turf.booleanEqual(pt4.geometry, pt5.geometry);
+//= true
```
Returns **[boolean][6]** true if the objects are equal, false otherwise
@@ -70,4 +76,4 @@ $ npm install @turf/turf
### Diagrams
-
\ No newline at end of file
+
diff --git a/packages/turf-boolean-equal/package.json b/packages/turf-boolean-equal/package.json
index 7cba2e933..93a52ac9c 100644
--- a/packages/turf-boolean-equal/package.json
+++ b/packages/turf-boolean-equal/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/boolean-equal",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf boolean-equal module",
"author": "Turf Authors",
"contributors": [
@@ -34,7 +34,7 @@
"exports": {
"./package.json": "./package.json",
".": {
- "types": "./index.d.ts",
+ "types": "./dist/js/index.d.ts",
"import": "./dist/es/index.js",
"require": "./dist/js/index.js"
}
@@ -45,13 +45,13 @@
"dist"
],
"scripts": {
- "bench": "ts-node bench.js",
- "build": "npm-run-all build:*",
+ "bench": "tsx bench.js",
+ "build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "ts-node -r esm test.js"
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js"
},
"devDependencies": {
"@types/geojson-equality": "^0.2.0",
@@ -62,14 +62,13 @@
"load-json-file": "*",
"npm-run-all": "*",
"tape": "*",
- "ts-node": "*",
- "tslint": "*",
+ "tsx": "*",
"typescript": "*"
},
"dependencies": {
- "@turf/clean-coords": "^7.0.0-alpha.0",
- "@turf/helpers": "^7.0.0-alpha.0",
- "@turf/invariant": "^7.0.0-alpha.0",
+ "@turf/clean-coords": "^7.0.0-alpha.2",
+ "@turf/helpers": "^7.0.0-alpha.2",
+ "@turf/invariant": "^7.0.0-alpha.2",
"geojson-equality": "0.1.6",
"tslib": "^2.3.0"
}
diff --git a/packages/turf-boolean-equal/test.js b/packages/turf-boolean-equal/test.js
index 3565587ee..e685e9fca 100644
--- a/packages/turf-boolean-equal/test.js
+++ b/packages/turf-boolean-equal/test.js
@@ -55,24 +55,30 @@ const line2 = lineString([
[8, 50],
[9, 50],
]);
-const poly1 = polygon([
+const poly1 = polygon(
[
- [8.5, 50],
- [9.5, 50],
- [9.5, 49],
- [8.5, 49],
- [8.5, 50],
+ [
+ [8.5, 50],
+ [9.5, 50],
+ [9.5, 49],
+ [8.5, 49],
+ [8.5, 50],
+ ],
],
-]);
-const poly2 = polygon([
+ { prop: "A" }
+);
+const poly2 = polygon(
[
- [8.5, 50],
- [9.5, 50],
- [9.5, 49],
- [8.5, 49],
- [8.5, 50],
+ [
+ [8.5, 50],
+ [9.5, 50],
+ [9.5, 49],
+ [8.5, 49],
+ [8.5, 50],
+ ],
],
-]);
+ { prop: "B" }
+);
const poly3 = polygon([
[
[10, 50],
@@ -82,12 +88,26 @@ const poly3 = polygon([
[10, 50],
],
]);
+const poly4 = polygon(
+ [
+ [
+ [8.5, 50],
+ [9.5, 50],
+ [9.5, 49],
+ [8.5, 49],
+ [8.5, 50],
+ ],
+ ],
+ { prop: "A" }
+);
test("turf-boolean-equal -- geometries", (t) => {
t.true(equal(line1.geometry, line2.geometry), "[true] LineString geometry");
t.true(equal(poly1.geometry, poly2.geometry), "[true] Polygon geometry");
+ t.true(equal(poly1, poly4), "[true] Polygon feature");
t.false(equal(poly1.geometry, poly3.geometry), "[false] Polygon geometry");
t.false(equal(pt, line1), "[false] different types");
+ t.false(equal(poly1, poly2), "[false] different properties");
t.end();
});
diff --git a/packages/turf-boolean-intersects/package.json b/packages/turf-boolean-intersects/package.json
index 30d671975..fc7bb85a1 100644
--- a/packages/turf-boolean-intersects/package.json
+++ b/packages/turf-boolean-intersects/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/boolean-intersects",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf boolean-intersects module",
"author": "Turf Authors",
"contributors": [
@@ -31,7 +31,7 @@
"exports": {
"./package.json": "./package.json",
".": {
- "types": "./index.d.ts",
+ "types": "./dist/js/index.d.ts",
"import": "./dist/es/index.js",
"require": "./dist/js/index.js"
}
@@ -42,13 +42,13 @@
"dist"
],
"scripts": {
- "bench": "ts-node bench.js",
- "build": "npm-run-all build:*",
+ "bench": "tsx bench.js",
+ "build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "ts-node -r esm test.js"
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js"
},
"devDependencies": {
"@types/tape": "*",
@@ -57,14 +57,13 @@
"load-json-file": "*",
"npm-run-all": "*",
"tape": "*",
- "ts-node": "*",
- "tslint": "*",
+ "tsx": "*",
"typescript": "*"
},
"dependencies": {
- "@turf/boolean-disjoint": "^7.0.0-alpha.0",
- "@turf/helpers": "^7.0.0-alpha.0",
- "@turf/meta": "^7.0.0-alpha.0",
+ "@turf/boolean-disjoint": "^7.0.0-alpha.2",
+ "@turf/helpers": "^7.0.0-alpha.2",
+ "@turf/meta": "^7.0.0-alpha.2",
"tslib": "^2.3.0"
}
}
diff --git a/packages/turf-boolean-overlap/package.json b/packages/turf-boolean-overlap/package.json
index e714c6087..3483c17af 100755
--- a/packages/turf-boolean-overlap/package.json
+++ b/packages/turf-boolean-overlap/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/boolean-overlap",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf boolean-overlap module",
"author": "Turf Authors",
"contributors": [
@@ -33,7 +33,7 @@
"exports": {
"./package.json": "./package.json",
".": {
- "types": "./index.d.ts",
+ "types": "./dist/js/index.d.ts",
"import": "./dist/es/index.js",
"require": "./dist/js/index.js"
}
@@ -44,13 +44,13 @@
"dist"
],
"scripts": {
- "bench": "ts-node bench.js",
- "build": "npm-run-all build:*",
+ "bench": "tsx bench.js",
+ "build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "ts-node -r esm test.js"
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js"
},
"devDependencies": {
"@types/geojson-equality": "^0.2.0",
@@ -61,16 +61,15 @@
"load-json-file": "*",
"npm-run-all": "*",
"tape": "*",
- "ts-node": "*",
- "tslint": "*",
+ "tsx": "*",
"typescript": "*"
},
"dependencies": {
- "@turf/helpers": "^7.0.0-alpha.0",
- "@turf/invariant": "^7.0.0-alpha.0",
- "@turf/line-intersect": "^7.0.0-alpha.0",
- "@turf/line-overlap": "^7.0.0-alpha.0",
- "@turf/meta": "^7.0.0-alpha.0",
+ "@turf/helpers": "^7.0.0-alpha.2",
+ "@turf/invariant": "^7.0.0-alpha.2",
+ "@turf/line-intersect": "^7.0.0-alpha.2",
+ "@turf/line-overlap": "^7.0.0-alpha.2",
+ "@turf/meta": "^7.0.0-alpha.2",
"geojson-equality": "0.1.6",
"tslib": "^2.3.0"
}
diff --git a/packages/turf-boolean-parallel/index.ts b/packages/turf-boolean-parallel/index.ts
index 1c18d5830..5b055138d 100644
--- a/packages/turf-boolean-parallel/index.ts
+++ b/packages/turf-boolean-parallel/index.ts
@@ -53,7 +53,7 @@ function booleanParallel(
function isParallel(segment1: Position[], segment2: Position[]) {
var slope1 = bearingToAzimuth(rhumbBearing(segment1[0], segment1[1]));
var slope2 = bearingToAzimuth(rhumbBearing(segment2[0], segment2[1]));
- return slope1 === slope2;
+ return slope1 === slope2 || (slope2 - slope1) % 180 === 0;
}
/**
diff --git a/packages/turf-boolean-parallel/package.json b/packages/turf-boolean-parallel/package.json
index 4b255131f..b2d68673c 100644
--- a/packages/turf-boolean-parallel/package.json
+++ b/packages/turf-boolean-parallel/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/boolean-parallel",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf boolean-parallel module",
"author": "Turf Authors",
"contributors": [
@@ -30,7 +30,7 @@
"exports": {
"./package.json": "./package.json",
".": {
- "types": "./index.d.ts",
+ "types": "./dist/js/index.d.ts",
"import": "./dist/es/index.js",
"require": "./dist/js/index.js"
}
@@ -41,13 +41,13 @@
"dist"
],
"scripts": {
- "bench": "ts-node bench.js",
- "build": "npm-run-all build:*",
+ "bench": "tsx bench.js",
+ "build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "ts-node -r esm test.js"
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js"
},
"devDependencies": {
"@types/tape": "*",
@@ -55,16 +55,15 @@
"load-json-file": "*",
"npm-run-all": "*",
"tape": "*",
- "ts-node": "*",
- "tslint": "*",
+ "tsx": "*",
"typescript": "*",
"write-json-file": "*"
},
"dependencies": {
- "@turf/clean-coords": "^7.0.0-alpha.0",
- "@turf/helpers": "^7.0.0-alpha.0",
- "@turf/line-segment": "^7.0.0-alpha.0",
- "@turf/rhumb-bearing": "^7.0.0-alpha.0",
+ "@turf/clean-coords": "^7.0.0-alpha.2",
+ "@turf/helpers": "^7.0.0-alpha.2",
+ "@turf/line-segment": "^7.0.0-alpha.2",
+ "@turf/rhumb-bearing": "^7.0.0-alpha.2",
"tslib": "^2.3.0"
}
}
diff --git a/packages/turf-boolean-parallel/test/true/opposites.geojson b/packages/turf-boolean-parallel/test/true/opposites.geojson
new file mode 100644
index 000000000..7911a6359
--- /dev/null
+++ b/packages/turf-boolean-parallel/test/true/opposites.geojson
@@ -0,0 +1,27 @@
+{
+ "type": "FeatureCollection",
+ "features": [
+ {
+ "type": "Feature",
+ "properties": {},
+ "geometry": {
+ "type": "LineString",
+ "coordinates": [
+ [0, 0],
+ [1, 0]
+ ]
+ }
+ },
+ {
+ "type": "Feature",
+ "properties": {},
+ "geometry": {
+ "type": "LineString",
+ "coordinates": [
+ [1, 0],
+ [0, 0]
+ ]
+ }
+ }
+ ]
+}
diff --git a/packages/turf-boolean-parallel/test/true/verticals.geojson b/packages/turf-boolean-parallel/test/true/verticals.geojson
new file mode 100644
index 000000000..074b85494
--- /dev/null
+++ b/packages/turf-boolean-parallel/test/true/verticals.geojson
@@ -0,0 +1,27 @@
+{
+ "type": "FeatureCollection",
+ "features": [
+ {
+ "type": "Feature",
+ "properties": {},
+ "geometry": {
+ "type": "LineString",
+ "coordinates": [
+ [0, 0],
+ [0, 1]
+ ]
+ }
+ },
+ {
+ "type": "Feature",
+ "properties": {},
+ "geometry": {
+ "type": "LineString",
+ "coordinates": [
+ [1, 0],
+ [1, 1]
+ ]
+ }
+ }
+ ]
+}
diff --git a/packages/turf-boolean-parallel/test/true/verticals3d.geojson b/packages/turf-boolean-parallel/test/true/verticals3d.geojson
new file mode 100644
index 000000000..a6ab7a281
--- /dev/null
+++ b/packages/turf-boolean-parallel/test/true/verticals3d.geojson
@@ -0,0 +1,27 @@
+{
+ "type": "FeatureCollection",
+ "features": [
+ {
+ "type": "Feature",
+ "properties": {},
+ "geometry": {
+ "type": "LineString",
+ "coordinates": [
+ [-10, 20, 0],
+ [-10, 10, 0]
+ ]
+ }
+ },
+ {
+ "type": "Feature",
+ "properties": {},
+ "geometry": {
+ "type": "LineString",
+ "coordinates": [
+ [-20, 20, 0],
+ [-20, 10, 0]
+ ]
+ }
+ }
+ ]
+}
diff --git a/packages/turf-boolean-point-in-polygon/index.ts b/packages/turf-boolean-point-in-polygon/index.ts
index 4bac934d7..f51168983 100644
--- a/packages/turf-boolean-point-in-polygon/index.ts
+++ b/packages/turf-boolean-point-in-polygon/index.ts
@@ -38,7 +38,7 @@ import { getCoord, getGeom } from "@turf/invariant";
*/
export default function booleanPointInPolygon<
G extends Polygon | MultiPolygon,
- P = GeoJsonProperties
+ P extends GeoJsonProperties = GeoJsonProperties,
>(
point: Coord,
polygon: Feature | G,
diff --git a/packages/turf-boolean-point-in-polygon/package.json b/packages/turf-boolean-point-in-polygon/package.json
index 5c8def30c..23f3a4d81 100644
--- a/packages/turf-boolean-point-in-polygon/package.json
+++ b/packages/turf-boolean-point-in-polygon/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/boolean-point-in-polygon",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf boolean-point-in-polygon module",
"author": "Turf Authors",
"license": "MIT",
@@ -29,7 +29,7 @@
"exports": {
"./package.json": "./package.json",
".": {
- "types": "./index.d.ts",
+ "types": "./dist/js/index.d.ts",
"import": "./dist/es/index.js",
"require": "./dist/js/index.js"
}
@@ -40,26 +40,25 @@
"dist"
],
"scripts": {
- "bench": "ts-node bench.js",
- "build": "npm-run-all build:*",
+ "bench": "tsx bench.js",
+ "build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "ts-node -r esm test.js"
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js"
},
"devDependencies": {
"@types/tape": "*",
"benchmark": "*",
"npm-run-all": "*",
"tape": "*",
- "ts-node": "*",
- "tslint": "*",
+ "tsx": "*",
"typescript": "*"
},
"dependencies": {
- "@turf/helpers": "^7.0.0-alpha.0",
- "@turf/invariant": "^7.0.0-alpha.0",
+ "@turf/helpers": "^7.0.0-alpha.2",
+ "@turf/invariant": "^7.0.0-alpha.2",
"point-in-polygon-hao": "^1.1.0",
"tslib": "^2.3.0"
}
diff --git a/packages/turf-boolean-point-on-line/package.json b/packages/turf-boolean-point-on-line/package.json
index 082e7a619..20dd3ea7b 100644
--- a/packages/turf-boolean-point-on-line/package.json
+++ b/packages/turf-boolean-point-on-line/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/boolean-point-on-line",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf boolean-point-on-line module",
"author": "Turf Authors",
"contributors": [
@@ -28,7 +28,7 @@
"exports": {
"./package.json": "./package.json",
".": {
- "types": "./index.d.ts",
+ "types": "./dist/js/index.d.ts",
"import": "./dist/es/index.js",
"require": "./dist/js/index.js"
}
@@ -39,13 +39,13 @@
"dist"
],
"scripts": {
- "bench": "ts-node bench.js",
- "build": "npm-run-all build:*",
+ "bench": "tsx bench.js",
+ "build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "ts-node -r esm test.js"
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js"
},
"devDependencies": {
"@types/tape": "*",
@@ -54,14 +54,13 @@
"load-json-file": "*",
"npm-run-all": "*",
"tape": "*",
- "ts-node": "*",
- "tslint": "*",
+ "tsx": "*",
"typescript": "*",
"write-json-file": "*"
},
"dependencies": {
- "@turf/helpers": "^7.0.0-alpha.0",
- "@turf/invariant": "^7.0.0-alpha.0",
+ "@turf/helpers": "^7.0.0-alpha.2",
+ "@turf/invariant": "^7.0.0-alpha.2",
"tslib": "^2.3.0"
}
}
diff --git a/packages/turf-boolean-touches/package.json b/packages/turf-boolean-touches/package.json
index ae66d6f55..dabe36e3f 100644
--- a/packages/turf-boolean-touches/package.json
+++ b/packages/turf-boolean-touches/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/boolean-touches",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf boolean-touches module",
"author": "Turf Authors",
"contributors": [
@@ -32,7 +32,7 @@
"exports": {
"./package.json": "./package.json",
".": {
- "types": "./index.d.ts",
+ "types": "./dist/js/index.d.ts",
"import": "./dist/es/index.js",
"require": "./dist/js/index.js"
}
@@ -43,13 +43,13 @@
"dist"
],
"scripts": {
- "bench": "ts-node bench.js",
- "build": "npm-run-all build:*",
+ "bench": "tsx bench.js",
+ "build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "ts-node -r esm test.js",
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js",
"test:types": "tsc --esModuleInterop --noEmit --strict types.ts"
},
"devDependencies": {
@@ -61,15 +61,14 @@
"load-json-file": "*",
"npm-run-all": "*",
"tape": "*",
- "ts-node": "*",
- "tslint": "*",
+ "tsx": "*",
"typescript": "*"
},
"dependencies": {
- "@turf/boolean-point-in-polygon": "^7.0.0-alpha.0",
- "@turf/boolean-point-on-line": "^7.0.0-alpha.0",
- "@turf/helpers": "^7.0.0-alpha.0",
- "@turf/invariant": "^7.0.0-alpha.0",
+ "@turf/boolean-point-in-polygon": "^7.0.0-alpha.2",
+ "@turf/boolean-point-on-line": "^7.0.0-alpha.2",
+ "@turf/helpers": "^7.0.0-alpha.2",
+ "@turf/invariant": "^7.0.0-alpha.2",
"tslib": "^2.3.0"
}
}
diff --git a/packages/turf-boolean-valid/package.json b/packages/turf-boolean-valid/package.json
index 307590143..ab2e1462d 100644
--- a/packages/turf-boolean-valid/package.json
+++ b/packages/turf-boolean-valid/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/boolean-valid",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf boolean-valid module",
"author": "Turf Authors",
"contributors": [
@@ -31,7 +31,7 @@
"exports": {
"./package.json": "./package.json",
".": {
- "types": "./index.d.ts",
+ "types": "./dist/js/index.d.ts",
"import": "./dist/es/index.js",
"require": "./dist/js/index.js"
}
@@ -42,13 +42,13 @@
"dist"
],
"scripts": {
- "bench": "ts-node bench.js",
- "build": "npm-run-all build:*",
+ "bench": "tsx bench.js",
+ "build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "ts-node -r esm test.js"
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js"
},
"devDependencies": {
"@types/tape": "*",
@@ -59,20 +59,19 @@
"load-json-file": "*",
"npm-run-all": "*",
"tape": "*",
- "ts-node": "*",
- "tslint": "*",
+ "tsx": "*",
"typescript": "*"
},
"dependencies": {
- "@turf/bbox": "^7.0.0-alpha.0",
- "@turf/boolean-crosses": "^7.0.0-alpha.0",
- "@turf/boolean-disjoint": "^7.0.0-alpha.0",
- "@turf/boolean-overlap": "^7.0.0-alpha.0",
- "@turf/boolean-point-in-polygon": "^7.0.0-alpha.0",
- "@turf/boolean-point-on-line": "^7.0.0-alpha.0",
- "@turf/helpers": "^7.0.0-alpha.0",
- "@turf/invariant": "^7.0.0-alpha.0",
- "@turf/line-intersect": "^7.0.0-alpha.0",
+ "@turf/bbox": "^7.0.0-alpha.2",
+ "@turf/boolean-crosses": "^7.0.0-alpha.2",
+ "@turf/boolean-disjoint": "^7.0.0-alpha.2",
+ "@turf/boolean-overlap": "^7.0.0-alpha.2",
+ "@turf/boolean-point-in-polygon": "^7.0.0-alpha.2",
+ "@turf/boolean-point-on-line": "^7.0.0-alpha.2",
+ "@turf/helpers": "^7.0.0-alpha.2",
+ "@turf/invariant": "^7.0.0-alpha.2",
+ "@turf/line-intersect": "^7.0.0-alpha.2",
"geojson-polygon-self-intersections": "1.2.x",
"tslib": "^2.3.0"
}
diff --git a/packages/turf-boolean-within/package.json b/packages/turf-boolean-within/package.json
index 8b5f624d2..e5fda7cec 100644
--- a/packages/turf-boolean-within/package.json
+++ b/packages/turf-boolean-within/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/boolean-within",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf boolean-within module",
"author": "Turf Authors",
"contributors": [
@@ -32,7 +32,7 @@
"exports": {
"./package.json": "./package.json",
".": {
- "types": "./index.d.ts",
+ "types": "./dist/js/index.d.ts",
"import": "./dist/es/index.js",
"require": "./dist/js/index.js"
}
@@ -43,13 +43,13 @@
"dist"
],
"scripts": {
- "bench": "ts-node bench.js",
- "build": "npm-run-all build:*",
+ "bench": "tsx bench.js",
+ "build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "ts-node -r esm test.js",
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js",
"test:types": "tsc --esModuleInterop --noEmit --strict types.ts"
},
"devDependencies": {
@@ -61,16 +61,15 @@
"load-json-file": "*",
"npm-run-all": "*",
"tape": "*",
- "ts-node": "*",
- "tslint": "*",
+ "tsx": "*",
"typescript": "*"
},
"dependencies": {
- "@turf/bbox": "^7.0.0-alpha.0",
- "@turf/boolean-point-in-polygon": "^7.0.0-alpha.0",
- "@turf/boolean-point-on-line": "^7.0.0-alpha.0",
- "@turf/helpers": "^7.0.0-alpha.0",
- "@turf/invariant": "^7.0.0-alpha.0",
+ "@turf/bbox": "^7.0.0-alpha.2",
+ "@turf/boolean-point-in-polygon": "^7.0.0-alpha.2",
+ "@turf/boolean-point-on-line": "^7.0.0-alpha.2",
+ "@turf/helpers": "^7.0.0-alpha.2",
+ "@turf/invariant": "^7.0.0-alpha.2",
"tslib": "^2.3.0"
}
}
diff --git a/packages/turf-buffer/index.js b/packages/turf-buffer/index.js
index 60a367b7f..8c51ff419 100644
--- a/packages/turf-buffer/index.js
+++ b/packages/turf-buffer/index.js
@@ -1,5 +1,5 @@
import center from "@turf/center";
-import { BufferOp, GeoJSONReader, GeoJSONWriter } from "@turf/jsts";
+import jsts from "@turf/jsts";
import { geomEach, featureEach } from "@turf/meta";
import { geoAzimuthalEquidistant } from "d3-geo";
import {
@@ -10,6 +10,8 @@ import {
earthRadius,
} from "@turf/helpers";
+const { BufferOp, GeoJSONReader, GeoJSONWriter } = jsts;
+
/**
* Calculates a buffer for input features for a given radius. Units supported are miles, kilometers, and degrees.
*
diff --git a/packages/turf-buffer/package.json b/packages/turf-buffer/package.json
index 04f7e6955..fe7d3260f 100644
--- a/packages/turf-buffer/package.json
+++ b/packages/turf-buffer/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/buffer",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf buffer module",
"author": "Turf Authors",
"contributors": [
@@ -47,29 +47,30 @@
"index.d.ts"
],
"scripts": {
- "bench": "node -r esm bench.js",
+ "bench": "tsx bench.js",
"build": "rollup -c ../../rollup.config.js && echo '{\"type\":\"module\"}' > dist/es/package.json",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "node -r esm test.js",
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js",
"test:types": "tsc --esModuleInterop --noEmit --strict types.ts"
},
"devDependencies": {
- "@turf/truncate": "^7.0.0-alpha.0",
+ "@turf/truncate": "^7.0.0-alpha.2",
"benchmark": "*",
"load-json-file": "*",
"npm-run-all": "*",
"rollup": "*",
"tape": "*",
+ "tsx": "*",
"write-json-file": "*"
},
"dependencies": {
- "@turf/bbox": "^7.0.0-alpha.0",
- "@turf/center": "^7.0.0-alpha.0",
- "@turf/helpers": "^7.0.0-alpha.0",
+ "@turf/bbox": "^7.0.0-alpha.2",
+ "@turf/center": "^7.0.0-alpha.2",
+ "@turf/helpers": "^7.0.0-alpha.2",
"@turf/jsts": "^2.7.1",
- "@turf/meta": "^7.0.0-alpha.0",
- "@turf/projection": "^7.0.0-alpha.0",
+ "@turf/meta": "^7.0.0-alpha.2",
+ "@turf/projection": "^7.0.0-alpha.2",
"d3-geo": "1.7.1"
}
}
diff --git a/packages/turf-center-mean/index.ts b/packages/turf-center-mean/index.ts
index 5dd5cd751..17cea0f78 100644
--- a/packages/turf-center-mean/index.ts
+++ b/packages/turf-center-mean/index.ts
@@ -28,7 +28,7 @@ import { isNumber, point, Id } from "@turf/helpers";
* mean.properties['marker-size'] = 'large';
* mean.properties['marker-color'] = '#000';
*/
-function centerMean(
+function centerMean
(
geojson: any, // To-Do include Typescript AllGeoJSON
options: { properties?: P; bbox?: BBox; id?: Id; weight?: string } = {}
): Feature {
diff --git a/packages/turf-center-mean/package.json b/packages/turf-center-mean/package.json
index 58e6fc1f6..8681116f1 100644
--- a/packages/turf-center-mean/package.json
+++ b/packages/turf-center-mean/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/center-mean",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf center-mean module",
"author": "Turf Authors",
"contributors": [
@@ -33,7 +33,7 @@
"exports": {
"./package.json": "./package.json",
".": {
- "types": "./index.d.ts",
+ "types": "./dist/js/index.d.ts",
"import": "./dist/es/index.js",
"require": "./dist/js/index.js"
}
@@ -44,33 +44,32 @@
"dist"
],
"scripts": {
- "bench": "ts-node bench.js",
- "build": "npm-run-all build:*",
+ "bench": "tsx bench.js",
+ "build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "ts-node -r esm test.js",
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js",
"test:types": "tsc --esModuleInterop --noEmit --strict types.ts"
},
"devDependencies": {
- "@turf/center": "^7.0.0-alpha.0",
- "@turf/truncate": "^7.0.0-alpha.0",
+ "@turf/center": "^7.0.0-alpha.2",
+ "@turf/truncate": "^7.0.0-alpha.2",
"@types/tape": "*",
"benchmark": "*",
"glob": "*",
"load-json-file": "*",
"npm-run-all": "*",
"tape": "*",
- "ts-node": "*",
- "tslint": "*",
+ "tsx": "*",
"typescript": "*",
"write-json-file": "*"
},
"dependencies": {
- "@turf/bbox": "^7.0.0-alpha.0",
- "@turf/helpers": "^7.0.0-alpha.0",
- "@turf/meta": "^7.0.0-alpha.0",
+ "@turf/bbox": "^7.0.0-alpha.2",
+ "@turf/helpers": "^7.0.0-alpha.2",
+ "@turf/meta": "^7.0.0-alpha.2",
"tslib": "^2.3.0"
}
}
diff --git a/packages/turf-center-median/package.json b/packages/turf-center-median/package.json
index b4528ff05..420d3d4fb 100644
--- a/packages/turf-center-median/package.json
+++ b/packages/turf-center-median/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/center-median",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf center-median module",
"author": "Turf Authors",
"contributors": [
@@ -28,7 +28,7 @@
"exports": {
"./package.json": "./package.json",
".": {
- "types": "./index.d.ts",
+ "types": "./dist/js/index.d.ts",
"import": "./dist/es/index.js",
"require": "./dist/js/index.js"
}
@@ -39,35 +39,34 @@
"dist"
],
"scripts": {
- "bench": "ts-node bench.js",
- "build": "npm-run-all build:*",
+ "bench": "tsx bench.js",
+ "build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "ts-node -r esm test.js"
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js"
},
"devDependencies": {
- "@turf/center": "^7.0.0-alpha.0",
- "@turf/center-of-mass": "^7.0.0-alpha.0",
- "@turf/random": "^7.0.0-alpha.0",
- "@turf/truncate": "^7.0.0-alpha.0",
+ "@turf/center": "^7.0.0-alpha.2",
+ "@turf/center-of-mass": "^7.0.0-alpha.2",
+ "@turf/random": "^7.0.0-alpha.2",
+ "@turf/truncate": "^7.0.0-alpha.2",
"@types/tape": "*",
"benchmark": "*",
"load-json-file": "*",
"npm-run-all": "*",
"tape": "*",
- "ts-node": "*",
- "tslint": "*",
+ "tsx": "*",
"typescript": "*",
"write-json-file": "*"
},
"dependencies": {
- "@turf/center-mean": "^7.0.0-alpha.0",
- "@turf/centroid": "^7.0.0-alpha.0",
- "@turf/distance": "^7.0.0-alpha.0",
- "@turf/helpers": "^7.0.0-alpha.0",
- "@turf/meta": "^7.0.0-alpha.0",
+ "@turf/center-mean": "^7.0.0-alpha.2",
+ "@turf/centroid": "^7.0.0-alpha.2",
+ "@turf/distance": "^7.0.0-alpha.2",
+ "@turf/helpers": "^7.0.0-alpha.2",
+ "@turf/meta": "^7.0.0-alpha.2",
"tslib": "^2.3.0"
}
}
diff --git a/packages/turf-center-of-mass/index.ts b/packages/turf-center-of-mass/index.ts
index 9cb8c4b5a..f010aa5ad 100644
--- a/packages/turf-center-of-mass/index.ts
+++ b/packages/turf-center-of-mass/index.ts
@@ -21,7 +21,7 @@ import { coordEach } from "@turf/meta";
* //addToMap
* var addToMap = [polygon, center]
*/
-function centerOfMass(
+function centerOfMass
(
geojson: any,
options: {
properties?: P;
diff --git a/packages/turf-center-of-mass/package.json b/packages/turf-center-of-mass/package.json
index 9c2a21069..a65459f60 100644
--- a/packages/turf-center-of-mass/package.json
+++ b/packages/turf-center-of-mass/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/center-of-mass",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf center-of-mass module",
"author": "Turf Authors",
"license": "MIT",
@@ -25,7 +25,7 @@
"exports": {
"./package.json": "./package.json",
".": {
- "types": "./index.d.ts",
+ "types": "./dist/js/index.d.ts",
"import": "./dist/es/index.js",
"require": "./dist/js/index.js"
}
@@ -36,13 +36,13 @@
"dist"
],
"scripts": {
- "bench": "ts-node bench.js",
- "build": "npm-run-all build:*",
+ "bench": "tsx bench.js",
+ "build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "ts-node -r esm test.js",
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js",
"test:types": "tsc --esModuleInterop --noEmit --strict types.ts"
},
"devDependencies": {
@@ -52,17 +52,16 @@
"load-json-file": "*",
"npm-run-all": "*",
"tape": "*",
- "ts-node": "*",
- "tslint": "*",
+ "tsx": "*",
"typescript": "*",
"write-json-file": "*"
},
"dependencies": {
- "@turf/centroid": "^7.0.0-alpha.0",
- "@turf/convex": "^7.0.0-alpha.0",
- "@turf/helpers": "^7.0.0-alpha.0",
- "@turf/invariant": "^7.0.0-alpha.0",
- "@turf/meta": "^7.0.0-alpha.0",
+ "@turf/centroid": "^7.0.0-alpha.2",
+ "@turf/convex": "^7.0.0-alpha.2",
+ "@turf/helpers": "^7.0.0-alpha.2",
+ "@turf/invariant": "^7.0.0-alpha.2",
+ "@turf/meta": "^7.0.0-alpha.2",
"tslib": "^2.3.0"
}
}
diff --git a/packages/turf-center/index.ts b/packages/turf-center/index.ts
index d5f25390c..268513c5f 100644
--- a/packages/turf-center/index.ts
+++ b/packages/turf-center/index.ts
@@ -26,7 +26,7 @@ import { point, Id, AllGeoJSON } from "@turf/helpers";
* center.properties['marker-size'] = 'large';
* center.properties['marker-color'] = '#000';
*/
-function center
(
+function center
(
geojson: AllGeoJSON,
options: { properties?: P; bbox?: BBox; id?: Id } = {}
): Feature {
diff --git a/packages/turf-center/package.json b/packages/turf-center/package.json
index ebf21fe27..2118a339b 100644
--- a/packages/turf-center/package.json
+++ b/packages/turf-center/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/center",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf center module",
"author": "Turf Authors",
"license": "MIT",
@@ -29,7 +29,7 @@
"exports": {
"./package.json": "./package.json",
".": {
- "types": "./index.d.ts",
+ "types": "./dist/js/index.d.ts",
"import": "./dist/es/index.js",
"require": "./dist/js/index.js"
}
@@ -40,32 +40,31 @@
"dist"
],
"scripts": {
- "bench": "ts-node bench.js",
- "build": "npm-run-all build:*",
+ "bench": "tsx bench.js",
+ "build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "ts-node -r esm test.js",
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js",
"test:types": "tsc --esModuleInterop --noEmit --strict types.ts"
},
"devDependencies": {
- "@turf/bbox-polygon": "^7.0.0-alpha.0",
- "@turf/meta": "^7.0.0-alpha.0",
+ "@turf/bbox-polygon": "^7.0.0-alpha.2",
+ "@turf/meta": "^7.0.0-alpha.2",
"@types/tape": "*",
"benchmark": "*",
"glob": "*",
"load-json-file": "*",
"npm-run-all": "*",
"tape": "*",
- "ts-node": "*",
- "tslint": "*",
+ "tsx": "*",
"typescript": "*",
"write-json-file": "*"
},
"dependencies": {
- "@turf/bbox": "^7.0.0-alpha.0",
- "@turf/helpers": "^7.0.0-alpha.0",
+ "@turf/bbox": "^7.0.0-alpha.2",
+ "@turf/helpers": "^7.0.0-alpha.2",
"tslib": "^2.3.0"
}
}
diff --git a/packages/turf-centroid/index.ts b/packages/turf-centroid/index.ts
index 4f13b13ea..7f30d53e7 100644
--- a/packages/turf-centroid/index.ts
+++ b/packages/turf-centroid/index.ts
@@ -18,7 +18,7 @@ import { coordEach } from "@turf/meta";
* //addToMap
* var addToMap = [polygon, centroid]
*/
-function centroid(
+function centroid
(
geojson: AllGeoJSON,
options: {
properties?: P;
diff --git a/packages/turf-centroid/package.json b/packages/turf-centroid/package.json
index 8480e0e89..346783ec6 100644
--- a/packages/turf-centroid/package.json
+++ b/packages/turf-centroid/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/centroid",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf centroid module",
"author": "Turf Authors",
"license": "MIT",
@@ -27,7 +27,7 @@
"exports": {
"./package.json": "./package.json",
".": {
- "types": "./index.d.ts",
+ "types": "./dist/js/index.d.ts",
"import": "./dist/es/index.js",
"require": "./dist/js/index.js"
}
@@ -38,13 +38,13 @@
"dist"
],
"scripts": {
- "bench": "ts-node bench.js",
- "build": "npm-run-all build:*",
+ "bench": "tsx bench.js",
+ "build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "ts-node -r esm test.js",
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js",
"test:types": "tsc --esModuleInterop --noEmit --strict types.ts"
},
"devDependencies": {
@@ -55,14 +55,13 @@
"load-json-file": "*",
"npm-run-all": "*",
"tape": "*",
- "ts-node": "*",
- "tslint": "*",
+ "tsx": "*",
"typescript": "*",
"write-json-file": "*"
},
"dependencies": {
- "@turf/helpers": "^7.0.0-alpha.0",
- "@turf/meta": "^7.0.0-alpha.0",
+ "@turf/helpers": "^7.0.0-alpha.2",
+ "@turf/meta": "^7.0.0-alpha.2",
"tslib": "^2.3.0"
}
}
diff --git a/packages/turf-circle/index.ts b/packages/turf-circle/index.ts
index abfbfe896..a38672896 100644
--- a/packages/turf-circle/index.ts
+++ b/packages/turf-circle/index.ts
@@ -22,7 +22,7 @@ import { polygon, Units } from "@turf/helpers";
* //addToMap
* var addToMap = [turf.point(center), circle]
*/
-function circle
(
+function circle
(
center: number[] | Point | Feature,
radius: number,
options: {
diff --git a/packages/turf-circle/package.json b/packages/turf-circle/package.json
index c37946b78..27b13dd7f 100644
--- a/packages/turf-circle/package.json
+++ b/packages/turf-circle/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/circle",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf circle module",
"author": "Turf Authors",
"license": "MIT",
@@ -29,7 +29,7 @@
"exports": {
"./package.json": "./package.json",
".": {
- "types": "./index.d.ts",
+ "types": "./dist/js/index.d.ts",
"import": "./dist/es/index.js",
"require": "./dist/js/index.js"
}
@@ -40,31 +40,30 @@
"dist"
],
"scripts": {
- "bench": "ts-node bench.js",
- "build": "npm-run-all build:*",
+ "bench": "tsx bench.js",
+ "build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "ts-node -r esm test.js",
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js",
"test:types": "tsc --esModuleInterop --noEmit --strict types.ts"
},
"devDependencies": {
"@mapbox/geojsonhint": "*",
- "@turf/truncate": "^7.0.0-alpha.0",
+ "@turf/truncate": "^7.0.0-alpha.2",
"@types/tape": "*",
"benchmark": "*",
"load-json-file": "*",
"npm-run-all": "*",
"tape": "*",
- "ts-node": "*",
- "tslint": "*",
+ "tsx": "*",
"typescript": "*",
"write-json-file": "*"
},
"dependencies": {
- "@turf/destination": "^7.0.0-alpha.0",
- "@turf/helpers": "^7.0.0-alpha.0",
+ "@turf/destination": "^7.0.0-alpha.2",
+ "@turf/helpers": "^7.0.0-alpha.2",
"tslib": "^2.3.0"
}
}
diff --git a/packages/turf-clean-coords/package.json b/packages/turf-clean-coords/package.json
index 42b77df09..24c0252d1 100644
--- a/packages/turf-clean-coords/package.json
+++ b/packages/turf-clean-coords/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/clean-coords",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf clean-coords module",
"author": "Turf Authors",
"contributors": [
@@ -29,7 +29,7 @@
"exports": {
"./package.json": "./package.json",
".": {
- "types": "./index.d.ts",
+ "types": "./dist/js/index.d.ts",
"import": "./dist/es/index.js",
"require": "./dist/js/index.js"
}
@@ -40,30 +40,29 @@
"dist"
],
"scripts": {
- "bench": "ts-node bench.js",
- "build": "npm-run-all build:*",
+ "bench": "tsx bench.js",
+ "build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "ts-node -r esm test.js",
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js",
"test:types": "tsc --esModuleInterop --noEmit --strict types.ts"
},
"devDependencies": {
- "@turf/truncate": "^7.0.0-alpha.0",
+ "@turf/truncate": "^7.0.0-alpha.2",
"@types/tape": "*",
"benchmark": "*",
"load-json-file": "*",
"npm-run-all": "*",
"tape": "*",
- "ts-node": "*",
- "tslint": "*",
+ "tsx": "*",
"typescript": "*",
"write-json-file": "*"
},
"dependencies": {
- "@turf/helpers": "^7.0.0-alpha.0",
- "@turf/invariant": "^7.0.0-alpha.0",
+ "@turf/helpers": "^7.0.0-alpha.2",
+ "@turf/invariant": "^7.0.0-alpha.2",
"tslib": "^2.3.0"
}
}
diff --git a/packages/turf-clone/package.json b/packages/turf-clone/package.json
index f391b6b33..0e6577809 100644
--- a/packages/turf-clone/package.json
+++ b/packages/turf-clone/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/clone",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf clone module",
"author": "Turf Authors",
"contributors": [
@@ -28,7 +28,7 @@
"exports": {
"./package.json": "./package.json",
".": {
- "types": "./index.d.ts",
+ "types": "./dist/js/index.d.ts",
"import": "./dist/es/index.js",
"require": "./dist/js/index.js"
}
@@ -39,27 +39,26 @@
"dist"
],
"scripts": {
- "bench": "ts-node bench.js",
- "build": "npm-run-all build:*",
+ "bench": "tsx bench.js",
+ "build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "ts-node -r esm test.js",
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js",
"test:types": "tsc --esModuleInterop --noEmit --strict types.ts"
},
"devDependencies": {
- "@turf/meta": "^7.0.0-alpha.0",
+ "@turf/meta": "^7.0.0-alpha.2",
"@types/tape": "*",
"benchmark": "*",
"npm-run-all": "*",
"tape": "*",
- "ts-node": "*",
- "tslint": "*",
+ "tsx": "*",
"typescript": "*"
},
"dependencies": {
- "@turf/helpers": "^7.0.0-alpha.0",
+ "@turf/helpers": "^7.0.0-alpha.2",
"tslib": "^2.3.0"
}
}
diff --git a/packages/turf-clusters-dbscan/package.json b/packages/turf-clusters-dbscan/package.json
index 1b1b5ab68..b686160a6 100644
--- a/packages/turf-clusters-dbscan/package.json
+++ b/packages/turf-clusters-dbscan/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/clusters-dbscan",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf clusters-dbscan module",
"author": "Turf Authors",
"contributors": [
@@ -35,7 +35,7 @@
"exports": {
"./package.json": "./package.json",
".": {
- "types": "./index.d.ts",
+ "types": "./dist/js/index.d.ts",
"import": "./dist/es/index.js",
"require": "./dist/js/index.js"
}
@@ -46,18 +46,18 @@
"dist"
],
"scripts": {
- "bench": "ts-node bench.js",
- "build": "npm-run-all build:*",
+ "bench": "tsx bench.js",
+ "build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "ts-node -r esm test.js",
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js",
"test:types": "tsc --esModuleInterop --noEmit --strict types.ts"
},
"devDependencies": {
- "@turf/centroid": "^7.0.0-alpha.0",
- "@turf/clusters": "^7.0.0-alpha.0",
+ "@turf/centroid": "^7.0.0-alpha.2",
+ "@turf/clusters": "^7.0.0-alpha.2",
"@types/density-clustering": "^1.3.0",
"@types/tape": "*",
"benchmark": "*",
@@ -66,16 +66,15 @@
"load-json-file": "*",
"npm-run-all": "*",
"tape": "*",
- "ts-node": "*",
- "tslint": "*",
+ "tsx": "*",
"typescript": "*",
"write-json-file": "*"
},
"dependencies": {
- "@turf/clone": "^7.0.0-alpha.0",
- "@turf/distance": "^7.0.0-alpha.0",
- "@turf/helpers": "^7.0.0-alpha.0",
- "@turf/meta": "^7.0.0-alpha.0",
+ "@turf/clone": "^7.0.0-alpha.2",
+ "@turf/distance": "^7.0.0-alpha.2",
+ "@turf/helpers": "^7.0.0-alpha.2",
+ "@turf/meta": "^7.0.0-alpha.2",
"density-clustering": "1.3.0",
"tslib": "^2.3.0"
}
diff --git a/packages/turf-clusters-kmeans/package.json b/packages/turf-clusters-kmeans/package.json
index 8373a4e1f..231e3fafe 100644
--- a/packages/turf-clusters-kmeans/package.json
+++ b/packages/turf-clusters-kmeans/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/clusters-kmeans",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf clusters-kmeans module",
"author": "Turf Authors",
"contributors": [
@@ -34,7 +34,7 @@
"exports": {
"./package.json": "./package.json",
".": {
- "types": "./index.d.ts",
+ "types": "./dist/js/index.d.ts",
"import": "./dist/es/index.js",
"require": "./dist/js/index.js"
}
@@ -45,19 +45,19 @@
"dist"
],
"scripts": {
- "bench": "ts-node bench.js",
- "build": "npm-run-all build:*",
+ "bench": "tsx bench.js",
+ "build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "ts-node -r esm test.js",
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js",
"test:types": "tsc --esModuleInterop --noEmit --strict types.ts"
},
"devDependencies": {
- "@turf/centroid": "^7.0.0-alpha.0",
- "@turf/clusters": "^7.0.0-alpha.0",
- "@turf/random": "^7.0.0-alpha.0",
+ "@turf/centroid": "^7.0.0-alpha.2",
+ "@turf/clusters": "^7.0.0-alpha.2",
+ "@turf/random": "^7.0.0-alpha.2",
"@types/skmeans": "^0.11.2",
"@types/tape": "*",
"benchmark": "*",
@@ -67,16 +67,15 @@
"matrix-to-grid": "*",
"npm-run-all": "*",
"tape": "*",
- "ts-node": "*",
- "tslint": "*",
+ "tsx": "*",
"typescript": "*",
"write-json-file": "*"
},
"dependencies": {
- "@turf/clone": "^7.0.0-alpha.0",
- "@turf/helpers": "^7.0.0-alpha.0",
- "@turf/invariant": "^7.0.0-alpha.0",
- "@turf/meta": "^7.0.0-alpha.0",
+ "@turf/clone": "^7.0.0-alpha.2",
+ "@turf/helpers": "^7.0.0-alpha.2",
+ "@turf/invariant": "^7.0.0-alpha.2",
+ "@turf/meta": "^7.0.0-alpha.2",
"skmeans": "0.9.7",
"tslib": "^2.3.0"
}
diff --git a/packages/turf-clusters/index.ts b/packages/turf-clusters/index.ts
index 5b1c997cb..78ecc5649 100644
--- a/packages/turf-clusters/index.ts
+++ b/packages/turf-clusters/index.ts
@@ -1,4 +1,9 @@
-import { Feature, FeatureCollection, GeometryObject } from "geojson";
+import {
+ Feature,
+ FeatureCollection,
+ GeoJsonProperties,
+ GeometryObject,
+} from "geojson";
import { featureEach } from "@turf/meta";
import { featureCollection } from "@turf/helpers";
@@ -31,10 +36,10 @@ import { featureCollection } from "@turf/helpers";
* turf.getCluster(clustered, {'marker-symbol': 'square'}).length;
* //= 1
*/
-export function getCluster(
- geojson: FeatureCollection,
- filter: any
-): FeatureCollection {
+export function getCluster<
+ G extends GeometryObject,
+ P extends GeoJsonProperties = GeoJsonProperties,
+>(geojson: FeatureCollection, filter: any): FeatureCollection {
// Validation
if (!geojson) throw new Error("geojson is required");
if (geojson.type !== "FeatureCollection")
@@ -99,7 +104,10 @@ export function getCluster(
* values.push(clusterValue);
* });
*/
-export function clusterEach(
+export function clusterEach<
+ G extends GeometryObject,
+ P extends GeoJsonProperties = GeoJsonProperties,
+>(
geojson: FeatureCollection,
property: number | string,
callback: (
@@ -193,7 +201,10 @@ export function clusterEach(
* return previousValue.concat(clusterValue);
* }, []);
*/
-export function clusterReduce(
+export function clusterReduce<
+ G extends GeometryObject,
+ P extends GeoJsonProperties = GeoJsonProperties,
+>(
geojson: FeatureCollection,
property: number | string,
callback: (
diff --git a/packages/turf-clusters/package.json b/packages/turf-clusters/package.json
index 73c82a3e7..dc975c4b2 100644
--- a/packages/turf-clusters/package.json
+++ b/packages/turf-clusters/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/clusters",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf clusters module",
"author": "Turf Authors",
"contributors": [
@@ -31,7 +31,7 @@
"exports": {
"./package.json": "./package.json",
".": {
- "types": "./index.d.ts",
+ "types": "./dist/js/index.d.ts",
"import": "./dist/es/index.js",
"require": "./dist/js/index.js"
}
@@ -42,13 +42,13 @@
"dist"
],
"scripts": {
- "bench": "ts-node bench.js",
- "build": "npm-run-all build:*",
+ "bench": "tsx bench.js",
+ "build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "ts-node -r esm test.js",
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js",
"test:types": "tsc --esModuleInterop --noEmit --strict types.ts"
},
"devDependencies": {
@@ -56,13 +56,12 @@
"benchmark": "*",
"npm-run-all": "*",
"tape": "*",
- "ts-node": "*",
- "tslint": "*",
+ "tsx": "*",
"typescript": "*"
},
"dependencies": {
- "@turf/helpers": "^7.0.0-alpha.0",
- "@turf/meta": "^7.0.0-alpha.0",
+ "@turf/helpers": "^7.0.0-alpha.2",
+ "@turf/meta": "^7.0.0-alpha.2",
"tslib": "^2.3.0"
}
}
diff --git a/packages/turf-collect/package.json b/packages/turf-collect/package.json
index 45734a42c..b83d892e7 100644
--- a/packages/turf-collect/package.json
+++ b/packages/turf-collect/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/collect",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf collect module",
"author": "Turf Authors",
"contributors": [
@@ -32,7 +32,7 @@
"exports": {
"./package.json": "./package.json",
".": {
- "types": "./index.d.ts",
+ "types": "./dist/js/index.d.ts",
"import": "./dist/es/index.js",
"require": "./dist/js/index.js"
}
@@ -43,13 +43,13 @@
"dist"
],
"scripts": {
- "bench": "ts-node bench.js",
- "build": "npm-run-all build:*",
+ "bench": "tsx bench.js",
+ "build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "ts-node -r esm test.js"
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js"
},
"devDependencies": {
"@types/rbush": "^3.0.0",
@@ -57,14 +57,13 @@
"benchmark": "*",
"npm-run-all": "*",
"tape": "*",
- "ts-node": "*",
- "tslint": "*",
+ "tsx": "*",
"typescript": "*"
},
"dependencies": {
- "@turf/bbox": "^7.0.0-alpha.0",
- "@turf/boolean-point-in-polygon": "^7.0.0-alpha.0",
- "@turf/helpers": "^7.0.0-alpha.0",
+ "@turf/bbox": "^7.0.0-alpha.2",
+ "@turf/boolean-point-in-polygon": "^7.0.0-alpha.2",
+ "@turf/helpers": "^7.0.0-alpha.2",
"rbush": "^3.0.1",
"tslib": "^2.3.0"
}
diff --git a/packages/turf-combine/package.json b/packages/turf-combine/package.json
index 655706512..e8e53a089 100644
--- a/packages/turf-combine/package.json
+++ b/packages/turf-combine/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/combine",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf combine module",
"author": "Turf Authors",
"license": "MIT",
@@ -28,7 +28,7 @@
"exports": {
"./package.json": "./package.json",
".": {
- "types": "./index.d.ts",
+ "types": "./dist/js/index.d.ts",
"import": "./dist/es/index.js",
"require": "./dist/js/index.js"
}
@@ -39,26 +39,25 @@
"dist"
],
"scripts": {
- "bench": "ts-node bench.js",
- "build": "npm-run-all build:*",
+ "bench": "tsx bench.js",
+ "build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "ts-node -r esm test.js"
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js"
},
"devDependencies": {
"@types/tape": "*",
"benchmark": "*",
"npm-run-all": "*",
"tape": "*",
- "ts-node": "*",
- "tslint": "*",
+ "tsx": "*",
"typescript": "*"
},
"dependencies": {
- "@turf/helpers": "^7.0.0-alpha.0",
- "@turf/meta": "^7.0.0-alpha.0",
+ "@turf/helpers": "^7.0.0-alpha.2",
+ "@turf/meta": "^7.0.0-alpha.2",
"tslib": "^2.3.0"
}
}
diff --git a/packages/turf-concave/package.json b/packages/turf-concave/package.json
index 6c93db6fe..864f3b0d4 100644
--- a/packages/turf-concave/package.json
+++ b/packages/turf-concave/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/concave",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf concave module",
"author": "Turf Authors",
"contributors": [
@@ -38,7 +38,7 @@
"exports": {
"./package.json": "./package.json",
".": {
- "types": "./index.d.ts",
+ "types": "./dist/js/index.d.ts",
"import": "./dist/es/index.js",
"require": "./dist/js/index.js"
}
@@ -49,34 +49,33 @@
"dist"
],
"scripts": {
- "bench": "ts-node bench.js",
- "build": "npm-run-all build:*",
+ "bench": "tsx bench.js",
+ "build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "ts-node -r esm test.js"
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js"
},
"devDependencies": {
"@types/tape": "*",
- "@types/topojson-client": "^3.0.0",
- "@types/topojson-server": "^3.0.0",
+ "@types/topojson-client": "3.1.3",
+ "@types/topojson-server": "3.0.3",
"benchmark": "*",
"load-json-file": "*",
"npm-run-all": "*",
"tape": "*",
- "ts-node": "*",
- "tslint": "*",
+ "tsx": "*",
"typescript": "*",
"write-json-file": "*"
},
"dependencies": {
- "@turf/clone": "^7.0.0-alpha.0",
- "@turf/distance": "^7.0.0-alpha.0",
- "@turf/helpers": "^7.0.0-alpha.0",
- "@turf/invariant": "^7.0.0-alpha.0",
- "@turf/meta": "^7.0.0-alpha.0",
- "@turf/tin": "^7.0.0-alpha.0",
+ "@turf/clone": "^7.0.0-alpha.2",
+ "@turf/distance": "^7.0.0-alpha.2",
+ "@turf/helpers": "^7.0.0-alpha.2",
+ "@turf/invariant": "^7.0.0-alpha.2",
+ "@turf/meta": "^7.0.0-alpha.2",
+ "@turf/tin": "^7.0.0-alpha.2",
"topojson-client": "3.x",
"topojson-server": "3.x",
"tslib": "^2.3.0"
diff --git a/packages/turf-convex/index.ts b/packages/turf-convex/index.ts
index 49c2a01c2..18663bd64 100644
--- a/packages/turf-convex/index.ts
+++ b/packages/turf-convex/index.ts
@@ -31,7 +31,7 @@ import concaveman from "concaveman";
* //addToMap
* var addToMap = [points, hull]
*/
-export default function convex(
+export default function convex
(
geojson: AllGeoJSON,
options: {
concavity?: number;
diff --git a/packages/turf-convex/package.json b/packages/turf-convex/package.json
index 2429bf5b0..e9c153232 100644
--- a/packages/turf-convex/package.json
+++ b/packages/turf-convex/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/convex",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf convex module",
"author": "Turf Authors",
"license": "MIT",
@@ -25,7 +25,7 @@
"exports": {
"./package.json": "./package.json",
".": {
- "types": "./index.d.ts",
+ "types": "./dist/js/index.d.ts",
"import": "./dist/es/index.js",
"require": "./dist/js/index.js"
}
@@ -36,13 +36,13 @@
"dist"
],
"scripts": {
- "bench": "ts-node bench.js",
- "build": "npm-run-all build:*",
+ "bench": "tsx bench.js",
+ "build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "ts-node -r esm test.js"
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js"
},
"devDependencies": {
"@types/concaveman": "^1.1.3",
@@ -52,14 +52,13 @@
"load-json-file": "*",
"npm-run-all": "*",
"tape": "*",
- "ts-node": "*",
- "tslint": "*",
+ "tsx": "*",
"typescript": "*",
"write-json-file": "*"
},
"dependencies": {
- "@turf/helpers": "^7.0.0-alpha.0",
- "@turf/meta": "^7.0.0-alpha.0",
+ "@turf/helpers": "^7.0.0-alpha.2",
+ "@turf/meta": "^7.0.0-alpha.2",
"concaveman": "^1.2.1",
"tslib": "^2.3.0"
}
diff --git a/packages/turf-destination/index.ts b/packages/turf-destination/index.ts
index 91733dd61..72f012373 100644
--- a/packages/turf-destination/index.ts
+++ b/packages/turf-destination/index.ts
@@ -37,7 +37,9 @@ import { getCoord } from "@turf/invariant";
* destination.properties['marker-color'] = '#f00';
* point.properties['marker-color'] = '#0f0';
*/
-export default function destination
(
+export default function destination<
+ P extends GeoJsonProperties = GeoJsonProperties,
+>(
origin: Coord,
distance: number,
bearing: number,
diff --git a/packages/turf-destination/package.json b/packages/turf-destination/package.json
index 5e4b4f1b7..8e7f511ae 100644
--- a/packages/turf-destination/package.json
+++ b/packages/turf-destination/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/destination",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf destination module",
"author": "Turf Authors",
"license": "MIT",
@@ -29,7 +29,7 @@
"exports": {
"./package.json": "./package.json",
".": {
- "types": "./index.d.ts",
+ "types": "./dist/js/index.d.ts",
"import": "./dist/es/index.js",
"require": "./dist/js/index.js"
}
@@ -40,30 +40,29 @@
"dist"
],
"scripts": {
- "bench": "ts-node bench.js",
- "build": "npm-run-all build:*",
+ "bench": "tsx bench.js",
+ "build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "ts-node -r esm test.js"
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js"
},
"devDependencies": {
- "@turf/truncate": "^7.0.0-alpha.0",
+ "@turf/truncate": "^7.0.0-alpha.2",
"@types/tape": "*",
"benchmark": "*",
"glob": "*",
"load-json-file": "*",
"npm-run-all": "*",
"tape": "*",
- "ts-node": "*",
- "tslint": "*",
+ "tsx": "*",
"typescript": "*",
"write-json-file": "*"
},
"dependencies": {
- "@turf/helpers": "^7.0.0-alpha.0",
- "@turf/invariant": "^7.0.0-alpha.0",
+ "@turf/helpers": "^7.0.0-alpha.2",
+ "@turf/invariant": "^7.0.0-alpha.2",
"tslib": "^2.3.0"
}
}
diff --git a/packages/turf-difference/package.json b/packages/turf-difference/package.json
index 28785f516..957c28436 100644
--- a/packages/turf-difference/package.json
+++ b/packages/turf-difference/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/difference",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf difference module",
"author": "Turf Authors",
"license": "MIT",
@@ -37,11 +37,11 @@
"index.d.ts"
],
"scripts": {
- "bench": "node -r esm bench.js",
+ "bench": "tsx bench.js",
"build": "rollup -c ../../rollup.config.js && echo '{\"type\":\"module\"}' > dist/es/package.json",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "node -r esm test.js"
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js"
},
"devDependencies": {
"benchmark": "*",
@@ -50,11 +50,12 @@
"npm-run-all": "*",
"rollup": "*",
"tape": "*",
+ "tsx": "*",
"write-json-file": "*"
},
"dependencies": {
- "@turf/helpers": "^7.0.0-alpha.0",
- "@turf/meta": "^7.0.0-alpha.0",
+ "@turf/helpers": "^7.0.0-alpha.2",
+ "@turf/meta": "^7.0.0-alpha.2",
"polygon-clipping": "^0.15.3"
}
}
diff --git a/packages/turf-directional-mean/package.json b/packages/turf-directional-mean/package.json
index c68a86b17..1db696957 100644
--- a/packages/turf-directional-mean/package.json
+++ b/packages/turf-directional-mean/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/directional-mean",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf directional-mean module",
"author": "Turf Authors",
"contributors": [
@@ -28,7 +28,7 @@
"exports": {
"./package.json": "./package.json",
".": {
- "types": "./index.d.ts",
+ "types": "./dist/js/index.d.ts",
"import": "./dist/es/index.js",
"require": "./dist/js/index.js"
}
@@ -39,13 +39,13 @@
"dist"
],
"scripts": {
- "bench": "ts-node bench.js",
- "build": "npm-run-all build:*",
+ "bench": "tsx bench.js",
+ "build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "ts-node -r esm test.js"
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js"
},
"devDependencies": {
"@types/tape": "*",
@@ -53,19 +53,18 @@
"load-json-file": "*",
"npm-run-all": "*",
"tape": "*",
- "ts-node": "*",
- "tslint": "*",
+ "tsx": "*",
"typescript": "*",
"write-json-file": "*"
},
"dependencies": {
- "@turf/bearing": "^7.0.0-alpha.0",
- "@turf/centroid": "^7.0.0-alpha.0",
- "@turf/destination": "^7.0.0-alpha.0",
- "@turf/helpers": "^7.0.0-alpha.0",
- "@turf/invariant": "^7.0.0-alpha.0",
- "@turf/length": "^7.0.0-alpha.0",
- "@turf/meta": "^7.0.0-alpha.0",
+ "@turf/bearing": "^7.0.0-alpha.2",
+ "@turf/centroid": "^7.0.0-alpha.2",
+ "@turf/destination": "^7.0.0-alpha.2",
+ "@turf/helpers": "^7.0.0-alpha.2",
+ "@turf/invariant": "^7.0.0-alpha.2",
+ "@turf/length": "^7.0.0-alpha.2",
+ "@turf/meta": "^7.0.0-alpha.2",
"tslib": "^2.3.0"
}
}
diff --git a/packages/turf-dissolve/package.json b/packages/turf-dissolve/package.json
index 2318373a5..07bd63ae1 100644
--- a/packages/turf-dissolve/package.json
+++ b/packages/turf-dissolve/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/dissolve",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf dissolve module",
"author": "Turf Authors",
"license": "MIT",
@@ -40,11 +40,11 @@
"index.d.ts"
],
"scripts": {
- "bench": "node -r esm bench.js",
+ "bench": "tsx bench.js",
"build": "rollup -c ../../rollup.config.js && echo '{\"type\":\"module\"}' > dist/es/package.json",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "node -r esm test.js"
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js"
},
"devDependencies": {
"benchmark": "*",
@@ -52,13 +52,14 @@
"npm-run-all": "*",
"rollup": "*",
"tape": "*",
+ "tsx": "*",
"write-json-file": "*"
},
"dependencies": {
- "@turf/flatten": "^7.0.0-alpha.0",
- "@turf/helpers": "^7.0.0-alpha.0",
- "@turf/invariant": "^7.0.0-alpha.0",
- "@turf/meta": "^7.0.0-alpha.0",
+ "@turf/flatten": "^7.0.0-alpha.2",
+ "@turf/helpers": "^7.0.0-alpha.2",
+ "@turf/invariant": "^7.0.0-alpha.2",
+ "@turf/meta": "^7.0.0-alpha.2",
"polygon-clipping": "^0.15.3"
}
}
diff --git a/packages/turf-distance-weight/package.json b/packages/turf-distance-weight/package.json
index c91e20e44..b844093e3 100644
--- a/packages/turf-distance-weight/package.json
+++ b/packages/turf-distance-weight/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/distance-weight",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf distance-weight module",
"author": "Turf Authors",
"contributors": [
@@ -28,7 +28,7 @@
"exports": {
"./package.json": "./package.json",
".": {
- "types": "./index.d.ts",
+ "types": "./dist/js/index.d.ts",
"import": "./dist/es/index.js",
"require": "./dist/js/index.js"
}
@@ -39,13 +39,13 @@
"dist"
],
"scripts": {
- "bench": "ts-node bench.js",
- "build": "npm-run-all build:*",
+ "bench": "tsx bench.js",
+ "build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "ts-node -r esm test.js"
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js"
},
"devDependencies": {
"@types/tape": "*",
@@ -53,16 +53,15 @@
"load-json-file": "*",
"npm-run-all": "*",
"tape": "*",
- "ts-node": "*",
- "tslint": "*",
+ "tsx": "*",
"typescript": "*",
"write-json-file": "*"
},
"dependencies": {
- "@turf/centroid": "^7.0.0-alpha.0",
- "@turf/helpers": "^7.0.0-alpha.0",
- "@turf/invariant": "^7.0.0-alpha.0",
- "@turf/meta": "^7.0.0-alpha.0",
+ "@turf/centroid": "^7.0.0-alpha.2",
+ "@turf/helpers": "^7.0.0-alpha.2",
+ "@turf/invariant": "^7.0.0-alpha.2",
+ "@turf/meta": "^7.0.0-alpha.2",
"tslib": "^2.3.0"
}
}
diff --git a/packages/turf-distance/package.json b/packages/turf-distance/package.json
index 37d7d5798..7acf27e81 100644
--- a/packages/turf-distance/package.json
+++ b/packages/turf-distance/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/distance",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf distance module",
"author": "Turf Authors",
"license": "MIT",
@@ -27,7 +27,7 @@
"exports": {
"./package.json": "./package.json",
".": {
- "types": "./index.d.ts",
+ "types": "./dist/js/index.d.ts",
"import": "./dist/es/index.js",
"require": "./dist/js/index.js"
}
@@ -38,13 +38,13 @@
"dist"
],
"scripts": {
- "bench": "ts-node bench.js",
- "build": "npm-run-all build:*",
+ "bench": "tsx bench.js",
+ "build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "ts-node -r esm test.js"
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js"
},
"devDependencies": {
"@types/tape": "*",
@@ -52,14 +52,13 @@
"load-json-file": "*",
"npm-run-all": "*",
"tape": "*",
- "ts-node": "*",
- "tslint": "*",
+ "tsx": "*",
"typescript": "*",
"write-json-file": "*"
},
"dependencies": {
- "@turf/helpers": "^7.0.0-alpha.0",
- "@turf/invariant": "^7.0.0-alpha.0",
+ "@turf/helpers": "^7.0.0-alpha.2",
+ "@turf/invariant": "^7.0.0-alpha.2",
"tslib": "^2.3.0"
}
}
diff --git a/packages/turf-ellipse/package.json b/packages/turf-ellipse/package.json
index 3107598bc..4ab38015f 100644
--- a/packages/turf-ellipse/package.json
+++ b/packages/turf-ellipse/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/ellipse",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf ellipse module",
"author": "Turf Authors",
"contributors": [
@@ -40,30 +40,31 @@
"index.d.ts"
],
"scripts": {
- "bench": "node -r esm bench.js",
+ "bench": "tsx bench.js",
"build": "rollup -c ../../rollup.config.js && echo '{\"type\":\"module\"}' > dist/es/package.json",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "node -r esm test.js"
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js"
},
"devDependencies": {
"@mapbox/geojsonhint": "*",
- "@turf/bbox-polygon": "^7.0.0-alpha.0",
- "@turf/circle": "^7.0.0-alpha.0",
- "@turf/destination": "^7.0.0-alpha.0",
- "@turf/truncate": "^7.0.0-alpha.0",
+ "@turf/bbox-polygon": "^7.0.0-alpha.2",
+ "@turf/circle": "^7.0.0-alpha.2",
+ "@turf/destination": "^7.0.0-alpha.2",
+ "@turf/truncate": "^7.0.0-alpha.2",
"benchmark": "*",
"glob": "*",
"load-json-file": "*",
"npm-run-all": "*",
"rollup": "*",
"tape": "*",
+ "tsx": "*",
"write-json-file": "*"
},
"dependencies": {
- "@turf/helpers": "^7.0.0-alpha.0",
- "@turf/invariant": "^7.0.0-alpha.0",
- "@turf/rhumb-destination": "^7.0.0-alpha.0",
- "@turf/transform-rotate": "^7.0.0-alpha.0"
+ "@turf/helpers": "^7.0.0-alpha.2",
+ "@turf/invariant": "^7.0.0-alpha.2",
+ "@turf/rhumb-destination": "^7.0.0-alpha.2",
+ "@turf/transform-rotate": "^7.0.0-alpha.2"
}
}
diff --git a/packages/turf-envelope/package.json b/packages/turf-envelope/package.json
index 9d301eceb..f4990ab0f 100644
--- a/packages/turf-envelope/package.json
+++ b/packages/turf-envelope/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/envelope",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf envelope module",
"author": "Turf Authors",
"license": "MIT",
@@ -40,22 +40,23 @@
"index.d.ts"
],
"scripts": {
- "bench": "node -r esm bench.js",
+ "bench": "tsx bench.js",
"build": "rollup -c ../../rollup.config.js && echo '{\"type\":\"module\"}' > dist/es/package.json",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "node -r esm test.js"
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js"
},
"devDependencies": {
"benchmark": "*",
"load-json-file": "*",
"npm-run-all": "*",
"rollup": "*",
- "tape": "*"
+ "tape": "*",
+ "tsx": "*"
},
"dependencies": {
- "@turf/bbox": "^7.0.0-alpha.0",
- "@turf/bbox-polygon": "^7.0.0-alpha.0",
- "@turf/helpers": "^7.0.0-alpha.0"
+ "@turf/bbox": "^7.0.0-alpha.2",
+ "@turf/bbox-polygon": "^7.0.0-alpha.2",
+ "@turf/helpers": "^7.0.0-alpha.2"
}
}
diff --git a/packages/turf-explode/package.json b/packages/turf-explode/package.json
index a1ebf9d8f..08f7d89e8 100644
--- a/packages/turf-explode/package.json
+++ b/packages/turf-explode/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/explode",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf explode module",
"author": "Turf Authors",
"license": "MIT",
@@ -39,11 +39,11 @@
"index.d.ts"
],
"scripts": {
- "bench": "node -r esm bench.js",
+ "bench": "tsx bench.js",
"build": "rollup -c ../../rollup.config.js && echo '{\"type\":\"module\"}' > dist/es/package.json",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "node -r esm test.js"
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js"
},
"devDependencies": {
"benchmark": "*",
@@ -52,10 +52,11 @@
"npm-run-all": "*",
"rollup": "*",
"tape": "*",
+ "tsx": "*",
"write-json-file": "*"
},
"dependencies": {
- "@turf/helpers": "^7.0.0-alpha.0",
- "@turf/meta": "^7.0.0-alpha.0"
+ "@turf/helpers": "^7.0.0-alpha.2",
+ "@turf/meta": "^7.0.0-alpha.2"
}
}
diff --git a/packages/turf-flatten/package.json b/packages/turf-flatten/package.json
index a347254f2..75b45d277 100644
--- a/packages/turf-flatten/package.json
+++ b/packages/turf-flatten/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/flatten",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf flatten module",
"author": "Turf Authors",
"contributors": [
@@ -44,11 +44,11 @@
"index.d.ts"
],
"scripts": {
- "bench": "node -r esm bench.js",
+ "bench": "tsx bench.js",
"build": "rollup -c ../../rollup.config.js && echo '{\"type\":\"module\"}' > dist/es/package.json",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "node -r esm test.js",
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js",
"test:types": "tsc --esModuleInterop --noEmit --strict types.ts"
},
"devDependencies": {
@@ -57,10 +57,11 @@
"npm-run-all": "*",
"rollup": "*",
"tape": "*",
+ "tsx": "*",
"write-json-file": "*"
},
"dependencies": {
- "@turf/helpers": "^7.0.0-alpha.0",
- "@turf/meta": "^7.0.0-alpha.0"
+ "@turf/helpers": "^7.0.0-alpha.2",
+ "@turf/meta": "^7.0.0-alpha.2"
}
}
diff --git a/packages/turf-flip/package.json b/packages/turf-flip/package.json
index 88d32b34a..a3c560fac 100644
--- a/packages/turf-flip/package.json
+++ b/packages/turf-flip/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/flip",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf flip module",
"author": "Turf Authors",
"license": "MIT",
@@ -39,11 +39,11 @@
"index.d.ts"
],
"scripts": {
- "bench": "node -r esm bench.js",
+ "bench": "tsx bench.js",
"build": "rollup -c ../../rollup.config.js && echo '{\"type\":\"module\"}' > dist/es/package.json",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "node -r esm test.js",
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js",
"test:types": "tsc --esModuleInterop --noEmit --strict types.ts"
},
"devDependencies": {
@@ -52,11 +52,12 @@
"npm-run-all": "*",
"rollup": "*",
"tape": "*",
+ "tsx": "*",
"write-json-file": "*"
},
"dependencies": {
- "@turf/clone": "^7.0.0-alpha.0",
- "@turf/helpers": "^7.0.0-alpha.0",
- "@turf/meta": "^7.0.0-alpha.0"
+ "@turf/clone": "^7.0.0-alpha.2",
+ "@turf/helpers": "^7.0.0-alpha.2",
+ "@turf/meta": "^7.0.0-alpha.2"
}
}
diff --git a/packages/turf-great-circle/package.json b/packages/turf-great-circle/package.json
index 89ac79ef8..27a171df2 100644
--- a/packages/turf-great-circle/package.json
+++ b/packages/turf-great-circle/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/great-circle",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf great-circle module",
"author": "Turf Authors",
"contributors": [
@@ -45,24 +45,25 @@
"index.d.ts"
],
"scripts": {
- "bench": "node -r esm bench.js",
+ "bench": "tsx bench.js",
"build": "rollup -c ../../rollup.config.js && echo '{\"type\":\"module\"}' > dist/es/package.json",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "node -r esm test.js",
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js",
"test:types": "tsc --esModuleInterop --noEmit --strict types.ts"
},
"devDependencies": {
- "@turf/truncate": "^7.0.0-alpha.0",
+ "@turf/truncate": "^7.0.0-alpha.2",
"benchmark": "*",
"load-json-file": "*",
"npm-run-all": "*",
"rollup": "*",
"tape": "*",
+ "tsx": "*",
"write-json-file": "*"
},
"dependencies": {
- "@turf/helpers": "^7.0.0-alpha.0",
- "@turf/invariant": "^7.0.0-alpha.0"
+ "@turf/helpers": "^7.0.0-alpha.2",
+ "@turf/invariant": "^7.0.0-alpha.2"
}
}
diff --git a/packages/turf-helpers/index.ts b/packages/turf-helpers/index.ts
index be3beb038..5c1267937 100644
--- a/packages/turf-helpers/index.ts
+++ b/packages/turf-helpers/index.ts
@@ -137,7 +137,7 @@ export const areaFactors: Record = {
*/
export function feature<
G extends GeometryObject = Geometry,
- P = GeoJsonProperties
+ P extends GeoJsonProperties = GeoJsonProperties,
>(
geom: G | null,
properties?: P,
@@ -214,7 +214,7 @@ export function geometry(
*
* //=point
*/
-export function point(
+export function point
(
coordinates: Position,
properties?: P,
options: { bbox?: BBox; id?: Id } = {}
@@ -259,7 +259,7 @@ export function point
(
*
* //=points
*/
-export function points
(
+export function points
(
coordinates: Position[],
properties?: P,
options: { bbox?: BBox; id?: Id } = {}
@@ -287,7 +287,7 @@ export function points
(
*
* //=polygon
*/
-export function polygon
(
+export function polygon
(
coordinates: Position[][],
properties?: P,
options: { bbox?: BBox; id?: Id } = {}
@@ -335,7 +335,7 @@ export function polygon
(
*
* //=polygons
*/
-export function polygons
(
+export function polygons
(
coordinates: Position[][][],
properties?: P,
options: { bbox?: BBox; id?: Id } = {}
@@ -365,7 +365,7 @@ export function polygons
(
* //=linestring1
* //=linestring2
*/
-export function lineString
(
+export function lineString
(
coordinates: Position[],
properties?: P,
options: { bbox?: BBox; id?: Id } = {}
@@ -399,7 +399,7 @@ export function lineString
(
*
* //=linestrings
*/
-export function lineStrings
(
+export function lineStrings
(
coordinates: Position[][],
properties?: P,
options: { bbox?: BBox; id?: Id } = {}
@@ -436,7 +436,7 @@ export function lineStrings
(
*/
export function featureCollection<
G extends GeometryObject = Geometry,
- P = GeoJsonProperties
+ P extends GeoJsonProperties = GeoJsonProperties,
>(
features: Array>,
options: { bbox?: BBox; id?: Id } = {}
@@ -469,7 +469,9 @@ export function featureCollection<
*
* //=multiLine
*/
-export function multiLineString(
+export function multiLineString<
+ P extends GeoJsonProperties = GeoJsonProperties,
+>(
coordinates: Position[][],
properties?: P,
options: { bbox?: BBox; id?: Id } = {}
@@ -498,7 +500,7 @@ export function multiLineString
(
*
* //=multiPt
*/
-export function multiPoint
(
+export function multiPoint
(
coordinates: Position[],
properties?: P,
options: { bbox?: BBox; id?: Id } = {}
@@ -528,7 +530,7 @@ export function multiPoint
(
* //=multiPoly
*
*/
-export function multiPolygon
(
+export function multiPolygon
(
coordinates: Position[][][],
properties?: P,
options: { bbox?: BBox; id?: Id } = {}
@@ -558,7 +560,9 @@ export function multiPolygon
(
*
* // => collection
*/
-export function geometryCollection
(
+export function geometryCollection<
+ P extends GeoJsonProperties = GeoJsonProperties,
+>(
geometries: Array<
Point | LineString | Polygon | MultiPoint | MultiLineString | MultiPolygon
>,
diff --git a/packages/turf-helpers/package.json b/packages/turf-helpers/package.json
index a66bebe3d..47b1331b5 100644
--- a/packages/turf-helpers/package.json
+++ b/packages/turf-helpers/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/helpers",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf helpers module",
"author": "Turf Authors",
"contributors": [
@@ -33,7 +33,7 @@
"exports": {
"./package.json": "./package.json",
".": {
- "types": "./index.d.ts",
+ "types": "./dist/js/index.d.ts",
"import": "./dist/es/index.js",
"require": "./dist/js/index.js"
}
@@ -44,13 +44,13 @@
"dist"
],
"scripts": {
- "bench": "ts-node bench.js",
- "build": "npm-run-all build:*",
+ "bench": "tsx bench.js",
+ "build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "ts-node -r esm test.js",
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js",
"test:types": "tsc --esModuleInterop --noEmit --strict types.ts"
},
"devDependencies": {
@@ -58,8 +58,7 @@
"benchmark": "*",
"npm-run-all": "*",
"tape": "*",
- "ts-node": "*",
- "tslint": "*",
+ "tsx": "*",
"typescript": "*"
},
"dependencies": {
diff --git a/packages/turf-helpers/test.js b/packages/turf-helpers/test.js
index 5d21f6fee..a29258bf8 100644
--- a/packages/turf-helpers/test.js
+++ b/packages/turf-helpers/test.js
@@ -642,7 +642,7 @@ test("turf-helpers -- isNumber", (t) => {
t.true(isNumber("123"));
t.true(isNumber(+"123"));
t.true(isNumber("1e10000"));
- t.true(isNumber(1e10000));
+ t.true(isNumber(1e100));
t.true(isNumber(Infinity));
t.true(isNumber(-Infinity));
diff --git a/packages/turf-helpers/types.ts b/packages/turf-helpers/types.ts
index abd281c36..74ae02a68 100644
--- a/packages/turf-helpers/types.ts
+++ b/packages/turf-helpers/types.ts
@@ -152,7 +152,7 @@ isNumber(-123);
isNumber("123");
isNumber(+"123");
isNumber("1e10000");
-isNumber(1e10000);
+isNumber(1e100);
isNumber(Infinity);
isNumber(-Infinity);
diff --git a/packages/turf-hex-grid/bench.js b/packages/turf-hex-grid/bench.js
index e41084359..5e54c4eb6 100644
--- a/packages/turf-hex-grid/bench.js
+++ b/packages/turf-hex-grid/bench.js
@@ -1,6 +1,7 @@
const Benchmark = require("benchmark");
const grid = require("./index").default;
+// prettier-ignore
var bbox = [
-96.6357421875,
31.12819929911196,
diff --git a/packages/turf-hex-grid/index.ts b/packages/turf-hex-grid/index.ts
index ce8521fb8..f542b4982 100644
--- a/packages/turf-hex-grid/index.ts
+++ b/packages/turf-hex-grid/index.ts
@@ -34,7 +34,7 @@ import { polygon, featureCollection, Units } from "@turf/helpers";
* //addToMap
* var addToMap = [hexgrid];
*/
-function hexGrid
(
+function hexGrid
(
bbox: BBox,
cellSide: number,
options: {
diff --git a/packages/turf-hex-grid/package.json b/packages/turf-hex-grid/package.json
index 5590ecdc7..b7a89d9b4 100644
--- a/packages/turf-hex-grid/package.json
+++ b/packages/turf-hex-grid/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/hex-grid",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf hex-grid module",
"author": "Turf Authors",
"contributors": [
@@ -37,7 +37,7 @@
"exports": {
"./package.json": "./package.json",
".": {
- "types": "./index.d.ts",
+ "types": "./dist/js/index.d.ts",
"import": "./dist/es/index.js",
"require": "./dist/js/index.js"
}
@@ -48,33 +48,32 @@
"dist"
],
"scripts": {
- "bench": "ts-node bench.js",
- "build": "npm-run-all build:*",
+ "bench": "tsx bench.js",
+ "build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "ts-node -r esm test.js",
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js",
"test:types": "tsc --esModuleInterop --noEmit --strict types.ts"
},
"devDependencies": {
- "@turf/bbox-polygon": "^7.0.0-alpha.0",
- "@turf/truncate": "^7.0.0-alpha.0",
+ "@turf/bbox-polygon": "^7.0.0-alpha.2",
+ "@turf/truncate": "^7.0.0-alpha.2",
"@types/tape": "*",
"benchmark": "*",
"load-json-file": "*",
"npm-run-all": "*",
"tape": "*",
- "ts-node": "*",
- "tslint": "*",
+ "tsx": "*",
"typescript": "*",
"write-json-file": "*"
},
"dependencies": {
- "@turf/distance": "^7.0.0-alpha.0",
- "@turf/helpers": "^7.0.0-alpha.0",
- "@turf/intersect": "^7.0.0-alpha.0",
- "@turf/invariant": "^7.0.0-alpha.0",
+ "@turf/distance": "^7.0.0-alpha.2",
+ "@turf/helpers": "^7.0.0-alpha.2",
+ "@turf/intersect": "^7.0.0-alpha.2",
+ "@turf/invariant": "^7.0.0-alpha.2",
"tslib": "^2.3.0"
}
}
diff --git a/packages/turf-hex-grid/types.ts b/packages/turf-hex-grid/types.ts
index 83e6e41bc..550dffa38 100644
--- a/packages/turf-hex-grid/types.ts
+++ b/packages/turf-hex-grid/types.ts
@@ -1,6 +1,7 @@
import { BBox } from "geojson";
import hexGrid from "./index";
+// prettier-ignore
const bbox: BBox = [
-96.6357421875,
31.12819929911196,
diff --git a/packages/turf-interpolate/package.json b/packages/turf-interpolate/package.json
index ba2d9886a..ba6422217 100644
--- a/packages/turf-interpolate/package.json
+++ b/packages/turf-interpolate/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/interpolate",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf interpolate module",
"author": "Turf Authors",
"contributors": [
@@ -41,34 +41,35 @@
"index.d.ts"
],
"scripts": {
- "bench": "node -r esm bench.js",
+ "bench": "tsx bench.js",
"build": "rollup -c ../../rollup.config.js && echo '{\"type\":\"module\"}' > dist/es/package.json",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "node -r esm test.js",
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js",
"test:types": "tsc --esModuleInterop --noEmit --strict types.ts"
},
"devDependencies": {
- "@turf/truncate": "^7.0.0-alpha.0",
+ "@turf/truncate": "^7.0.0-alpha.2",
"benchmark": "*",
"chromatism": "*",
"load-json-file": "*",
"npm-run-all": "*",
"rollup": "*",
"tape": "*",
+ "tsx": "*",
"write-json-file": "*"
},
"dependencies": {
- "@turf/bbox": "^7.0.0-alpha.0",
- "@turf/centroid": "^7.0.0-alpha.0",
- "@turf/clone": "^7.0.0-alpha.0",
- "@turf/distance": "^7.0.0-alpha.0",
- "@turf/helpers": "^7.0.0-alpha.0",
- "@turf/hex-grid": "^7.0.0-alpha.0",
- "@turf/invariant": "^7.0.0-alpha.0",
- "@turf/meta": "^7.0.0-alpha.0",
- "@turf/point-grid": "^7.0.0-alpha.0",
- "@turf/square-grid": "^7.0.0-alpha.0",
- "@turf/triangle-grid": "^7.0.0-alpha.0"
+ "@turf/bbox": "^7.0.0-alpha.2",
+ "@turf/centroid": "^7.0.0-alpha.2",
+ "@turf/clone": "^7.0.0-alpha.2",
+ "@turf/distance": "^7.0.0-alpha.2",
+ "@turf/helpers": "^7.0.0-alpha.2",
+ "@turf/hex-grid": "^7.0.0-alpha.2",
+ "@turf/invariant": "^7.0.0-alpha.2",
+ "@turf/meta": "^7.0.0-alpha.2",
+ "@turf/point-grid": "^7.0.0-alpha.2",
+ "@turf/square-grid": "^7.0.0-alpha.2",
+ "@turf/triangle-grid": "^7.0.0-alpha.2"
}
}
diff --git a/packages/turf-intersect/index.ts b/packages/turf-intersect/index.ts
index 1c18ea8f5..3ed07bf21 100644
--- a/packages/turf-intersect/index.ts
+++ b/packages/turf-intersect/index.ts
@@ -44,7 +44,9 @@ import polygonClipping from "polygon-clipping";
* //addToMap
* var addToMap = [poly1, poly2, intersection];
*/
-export default function intersect
(
+export default function intersect<
+ P extends GeoJsonProperties = GeoJsonProperties,
+>(
features: FeatureCollection,
options: {
properties?: P;
diff --git a/packages/turf-intersect/package.json b/packages/turf-intersect/package.json
index c45a9042b..87f6fb141 100644
--- a/packages/turf-intersect/package.json
+++ b/packages/turf-intersect/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/intersect",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf intersect module",
"author": "Turf Authors",
"license": "MIT",
@@ -26,7 +26,7 @@
"exports": {
"./package.json": "./package.json",
".": {
- "types": "./index.d.ts",
+ "types": "./dist/js/index.d.ts",
"import": "./dist/es/index.js",
"require": "./dist/js/index.js"
}
@@ -37,13 +37,13 @@
"dist"
],
"scripts": {
- "bench": "ts-node bench.js",
- "build": "npm-run-all build:*",
+ "bench": "tsx bench.js",
+ "build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "ts-node -r esm test.js",
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js",
"test:types": "tsc --esModuleInterop --noEmit --strict types.ts"
},
"devDependencies": {
@@ -53,14 +53,13 @@
"load-json-file": "*",
"npm-run-all": "*",
"tape": "*",
- "ts-node": "*",
- "tslint": "*",
+ "tsx": "*",
"typescript": "*",
"write-json-file": "*"
},
"dependencies": {
- "@turf/helpers": "^7.0.0-alpha.0",
- "@turf/meta": "^7.0.0-alpha.0",
+ "@turf/helpers": "^7.0.0-alpha.2",
+ "@turf/meta": "^7.0.0-alpha.2",
"polygon-clipping": "^0.15.3",
"tslib": "^2.3.0"
}
diff --git a/packages/turf-invariant/index.ts b/packages/turf-invariant/index.ts
index 44e7004bc..078937d1f 100644
--- a/packages/turf-invariant/index.ts
+++ b/packages/turf-invariant/index.ts
@@ -71,7 +71,7 @@ export function getCoords<
| Polygon
| MultiPoint
| MultiLineString
- | MultiPolygon
+ | MultiPolygon,
>(coords: any[] | Feature | G): any[] {
if (Array.isArray(coords)) {
return coords;
diff --git a/packages/turf-invariant/package.json b/packages/turf-invariant/package.json
index c7e2c1fa4..25290ab51 100644
--- a/packages/turf-invariant/package.json
+++ b/packages/turf-invariant/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/invariant",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf invariant module",
"author": "Turf Authors",
"contributors": [
@@ -30,7 +30,7 @@
"exports": {
"./package.json": "./package.json",
".": {
- "types": "./index.d.ts",
+ "types": "./dist/js/index.d.ts",
"import": "./dist/es/index.js",
"require": "./dist/js/index.js"
}
@@ -41,25 +41,24 @@
"dist"
],
"scripts": {
- "bench": "ts-node bench.js",
- "build": "npm-run-all build:*",
+ "bench": "tsx bench.js",
+ "build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "ts-node -r esm test.js",
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js",
"test:types": "tsc --esModuleInterop --noEmit --strict types.ts"
},
"devDependencies": {
"benchmark": "*",
"npm-run-all": "*",
"tape": "*",
- "ts-node": "*",
- "tslint": "*",
+ "tsx": "*",
"typescript": "*"
},
"dependencies": {
- "@turf/helpers": "^7.0.0-alpha.0",
+ "@turf/helpers": "^7.0.0-alpha.2",
"tslib": "^2.3.0"
}
}
diff --git a/packages/turf-isobands/lib/marchingsquares-isobands.js b/packages/turf-isobands/lib/marchingsquares-isobands.js
index f6405a6bd..768d30dc3 100644
--- a/packages/turf-isobands/lib/marchingsquares-isobands.js
+++ b/packages/turf-isobands/lib/marchingsquares-isobands.js
@@ -1626,7 +1626,15 @@ function computeBandGrid(data, minV, bandwidth) {
lefttop,
leftbottom;
- topleft = topright = bottomleft = bottomright = righttop = rightbottom = lefttop = leftbottom = 0.5;
+ topleft =
+ topright =
+ bottomleft =
+ bottomright =
+ righttop =
+ rightbottom =
+ lefttop =
+ leftbottom =
+ 0.5;
var edges = [];
diff --git a/packages/turf-isobands/package.json b/packages/turf-isobands/package.json
index dd71d9574..dd05672d5 100644
--- a/packages/turf-isobands/package.json
+++ b/packages/turf-isobands/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/isobands",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf isobands module",
"author": "Turf Authors",
"contributors": [
@@ -33,7 +33,7 @@
"exports": {
"./package.json": "./package.json",
".": {
- "types": "./index.d.ts",
+ "types": "./dist/js/index.d.ts",
"import": "./dist/es/index.js",
"require": "./dist/js/index.js"
}
@@ -44,20 +44,20 @@
"dist"
],
"scripts": {
- "bench": "ts-node bench.js",
- "build": "npm-run-all build:*",
+ "bench": "tsx bench.js",
+ "build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "ts-node -r esm test.js"
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js"
},
"devDependencies": {
- "@turf/envelope": "^7.0.0-alpha.0",
- "@turf/point-grid": "^7.0.0-alpha.0",
- "@turf/random": "^7.0.0-alpha.0",
- "@turf/rhumb-destination": "^7.0.0-alpha.0",
- "@turf/truncate": "^7.0.0-alpha.0",
+ "@turf/envelope": "^7.0.0-alpha.2",
+ "@turf/point-grid": "^7.0.0-alpha.2",
+ "@turf/random": "^7.0.0-alpha.2",
+ "@turf/rhumb-destination": "^7.0.0-alpha.2",
+ "@turf/truncate": "^7.0.0-alpha.2",
"benchmark": "*",
"chroma-js": "*",
"load-json-file": "*",
@@ -65,19 +65,18 @@
"npm-run-all": "*",
"rollup": "*",
"tape": "*",
- "ts-node": "*",
- "tslint": "*",
+ "tsx": "*",
"typescript": "*",
"write-json-file": "*"
},
"dependencies": {
- "@turf/area": "^7.0.0-alpha.0",
- "@turf/bbox": "^7.0.0-alpha.0",
- "@turf/boolean-point-in-polygon": "^7.0.0-alpha.0",
- "@turf/explode": "^7.0.0-alpha.0",
- "@turf/helpers": "^7.0.0-alpha.0",
- "@turf/invariant": "^7.0.0-alpha.0",
- "@turf/meta": "^7.0.0-alpha.0",
+ "@turf/area": "^7.0.0-alpha.2",
+ "@turf/bbox": "^7.0.0-alpha.2",
+ "@turf/boolean-point-in-polygon": "^7.0.0-alpha.2",
+ "@turf/explode": "^7.0.0-alpha.2",
+ "@turf/helpers": "^7.0.0-alpha.2",
+ "@turf/invariant": "^7.0.0-alpha.2",
+ "@turf/meta": "^7.0.0-alpha.2",
"tslib": "^2.3.0"
}
}
diff --git a/packages/turf-isolines/package.json b/packages/turf-isolines/package.json
index a53298181..95c6351b8 100644
--- a/packages/turf-isolines/package.json
+++ b/packages/turf-isolines/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/isolines",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf isolines module",
"author": "Turf Authors",
"contributors": [
@@ -32,7 +32,7 @@
"exports": {
"./package.json": "./package.json",
".": {
- "types": "./index.d.ts",
+ "types": "./dist/js/index.d.ts",
"import": "./dist/es/index.js",
"require": "./dist/js/index.js"
}
@@ -43,37 +43,36 @@
"dist"
],
"scripts": {
- "bench": "ts-node bench.js",
- "build": "npm-run-all build:*",
+ "bench": "tsx bench.js",
+ "build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "ts-node -r esm test.js",
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js",
"test:types": "tsc --esModuleInterop --noEmit --strict types.ts"
},
"devDependencies": {
- "@turf/envelope": "^7.0.0-alpha.0",
- "@turf/point-grid": "^7.0.0-alpha.0",
- "@turf/random": "^7.0.0-alpha.0",
- "@turf/rhumb-destination": "^7.0.0-alpha.0",
- "@turf/truncate": "^7.0.0-alpha.0",
+ "@turf/envelope": "^7.0.0-alpha.2",
+ "@turf/point-grid": "^7.0.0-alpha.2",
+ "@turf/random": "^7.0.0-alpha.2",
+ "@turf/rhumb-destination": "^7.0.0-alpha.2",
+ "@turf/truncate": "^7.0.0-alpha.2",
"benchmark": "*",
"load-json-file": "*",
"matrix-to-grid": "*",
"npm-run-all": "*",
"rollup": "*",
"tape": "*",
- "ts-node": "*",
- "tslint": "*",
+ "tsx": "*",
"typescript": "*",
"write-json-file": "*"
},
"dependencies": {
- "@turf/bbox": "^7.0.0-alpha.0",
- "@turf/helpers": "^7.0.0-alpha.0",
- "@turf/invariant": "^7.0.0-alpha.0",
- "@turf/meta": "^7.0.0-alpha.0",
+ "@turf/bbox": "^7.0.0-alpha.2",
+ "@turf/helpers": "^7.0.0-alpha.2",
+ "@turf/invariant": "^7.0.0-alpha.2",
+ "@turf/meta": "^7.0.0-alpha.2",
"tslib": "^2.3.0"
}
}
diff --git a/packages/turf-kinks/index.ts b/packages/turf-kinks/index.ts
index 824f81356..9221e82c4 100644
--- a/packages/turf-kinks/index.ts
+++ b/packages/turf-kinks/index.ts
@@ -33,7 +33,7 @@ import { point } from "@turf/helpers";
* var addToMap = [poly, kinks]
*/
export default function kinks<
- T extends LineString | MultiLineString | Polygon | MultiPolygon
+ T extends LineString | MultiLineString | Polygon | MultiPolygon,
>(featureIn: Feature): FeatureCollection {
const results: FeatureCollection = {
type: "FeatureCollection",
diff --git a/packages/turf-kinks/package.json b/packages/turf-kinks/package.json
index 4413929ef..b7139d03d 100644
--- a/packages/turf-kinks/package.json
+++ b/packages/turf-kinks/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/kinks",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf kinks module",
"author": "Turf Authors",
"license": "MIT",
@@ -26,7 +26,7 @@
"exports": {
"./package.json": "./package.json",
".": {
- "types": "./index.d.ts",
+ "types": "./dist/js/index.d.ts",
"import": "./dist/es/index.js",
"require": "./dist/js/index.js"
}
@@ -37,27 +37,27 @@
"dist"
],
"scripts": {
- "bench": "ts-node bench.js",
- "build": "npm-run-all build:*",
+ "bench": "tsx bench.js",
+ "build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "ts-node -r esm test.js",
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js",
"test:types": "tsc --esModuleInterop --noEmit --strict types.ts"
},
"devDependencies": {
- "@turf/meta": "^7.0.0-alpha.0",
+ "@turf/meta": "^7.0.0-alpha.2",
"benchmark": "*",
"load-json-file": "*",
"npm-run-all": "*",
"tape": "*",
- "ts-node": "*",
+ "tsx": "*",
"typescript": "*",
"write-json-file": "*"
},
"dependencies": {
- "@turf/helpers": "^7.0.0-alpha.0",
+ "@turf/helpers": "^7.0.0-alpha.2",
"sweepline-intersections": "^1.5.0",
"tslib": "^2.3.0"
}
diff --git a/packages/turf-length/package.json b/packages/turf-length/package.json
index 0c311e6d2..1016e8baf 100644
--- a/packages/turf-length/package.json
+++ b/packages/turf-length/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/length",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf length module",
"author": "Turf Authors",
"contributors": [
@@ -33,7 +33,7 @@
"exports": {
"./package.json": "./package.json",
".": {
- "types": "./index.d.ts",
+ "types": "./dist/js/index.d.ts",
"import": "./dist/es/index.js",
"require": "./dist/js/index.js"
}
@@ -44,13 +44,13 @@
"dist"
],
"scripts": {
- "bench": "ts-node bench.js",
- "build": "npm-run-all build:*",
+ "bench": "tsx bench.js",
+ "build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "ts-node -r esm test.js"
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js"
},
"devDependencies": {
"@types/tape": "*",
@@ -58,15 +58,14 @@
"load-json-file": "*",
"npm-run-all": "*",
"tape": "*",
- "ts-node": "*",
- "tslint": "*",
+ "tsx": "*",
"typescript": "*",
"write-json-file": "*"
},
"dependencies": {
- "@turf/distance": "^7.0.0-alpha.0",
- "@turf/helpers": "^7.0.0-alpha.0",
- "@turf/meta": "^7.0.0-alpha.0",
+ "@turf/distance": "^7.0.0-alpha.2",
+ "@turf/helpers": "^7.0.0-alpha.2",
+ "@turf/meta": "^7.0.0-alpha.2",
"tslib": "^2.3.0"
}
}
diff --git a/packages/turf-line-arc/index.ts b/packages/turf-line-arc/index.ts
index 359c8a4f4..1cb9d9e82 100644
--- a/packages/turf-line-arc/index.ts
+++ b/packages/turf-line-arc/index.ts
@@ -13,7 +13,7 @@ import { Coord, lineString, Units } from "@turf/helpers";
* @param {number} bearing1 angle, in decimal degrees, of the first radius of the arc
* @param {number} bearing2 angle, in decimal degrees, of the second radius of the arc
* @param {Object} [options={}] Optional parameters
- * @param {number} [options.steps=64] number of steps
+ * @param {number} [options.steps=64] number of steps (straight segments) that will constitute the arc
* @param {string} [options.units='kilometers'] miles, kilometers, degrees, or radians
* @returns {Feature} line arc
* @example
@@ -57,21 +57,19 @@ export default function lineArc(
const arcStartDegree = angle1;
const arcEndDegree = angle1 < angle2 ? angle2 : angle2 + 360;
- let alfa = arcStartDegree;
+ let alpha = arcStartDegree;
const coordinates = [];
let i = 0;
-
- while (alfa < arcEndDegree) {
+ // How many degrees we'll swing around between each step.
+ const arcStep = (arcEndDegree - arcStartDegree) / steps;
+ // Add coords to the list, increasing the angle from our start bearing
+ // (alpha) by arcStep degrees until we reach the end bearing.
+ while (alpha <= arcEndDegree) {
coordinates.push(
- destination(center, radius, alfa, options).geometry.coordinates
+ destination(center, radius, alpha, options).geometry.coordinates
);
i++;
- alfa = arcStartDegree + (i * 360) / steps;
- }
- if (alfa >= arcEndDegree) {
- coordinates.push(
- destination(center, radius, arcEndDegree, options).geometry.coordinates
- );
+ alpha = arcStartDegree + i * arcStep;
}
return lineString(coordinates, properties);
}
@@ -81,11 +79,11 @@ export default function lineArc(
* and returns a valid angle between 0-360 degrees
*
* @private
- * @param {number} alfa angle between -180-180 degrees
+ * @param {number} alpha angle between -180-180 degrees
* @returns {number} angle between 0-360 degrees
*/
-function convertAngleTo360(alfa: number) {
- let beta = alfa % 360;
+function convertAngleTo360(alpha: number) {
+ let beta = alpha % 360;
if (beta < 0) {
beta += 360;
}
diff --git a/packages/turf-line-arc/package.json b/packages/turf-line-arc/package.json
index 2966ce6e4..46a23ab02 100644
--- a/packages/turf-line-arc/package.json
+++ b/packages/turf-line-arc/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/line-arc",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf line-arc module",
"author": "Turf Authors",
"license": "MIT",
@@ -25,7 +25,7 @@
"exports": {
"./package.json": "./package.json",
".": {
- "types": "./index.d.ts",
+ "types": "./dist/js/index.d.ts",
"import": "./dist/es/index.js",
"require": "./dist/js/index.js"
}
@@ -36,29 +36,29 @@
"dist"
],
"scripts": {
- "bench": "ts-node bench.js",
- "build": "npm-run-all build:*",
+ "bench": "tsx bench.js",
+ "build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "ts-node -r esm test.js",
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js",
"test:types": "tsc --esModuleInterop --noEmit --strict types.ts"
},
"devDependencies": {
- "@turf/truncate": "^7.0.0-alpha.0",
+ "@turf/truncate": "^7.0.0-alpha.2",
"benchmark": "*",
"load-json-file": "*",
"npm-run-all": "*",
"tape": "*",
- "ts-node": "*",
+ "tsx": "*",
"typescript": "*",
"write-json-file": "*"
},
"dependencies": {
- "@turf/circle": "^7.0.0-alpha.0",
- "@turf/destination": "^7.0.0-alpha.0",
- "@turf/helpers": "^7.0.0-alpha.0",
+ "@turf/circle": "^7.0.0-alpha.2",
+ "@turf/destination": "^7.0.0-alpha.2",
+ "@turf/helpers": "^7.0.0-alpha.2",
"tslib": "^2.3.0"
}
}
diff --git a/packages/turf-line-arc/test.js b/packages/turf-line-arc/test.js
index b2150d309..85cb507b8 100644
--- a/packages/turf-line-arc/test.js
+++ b/packages/turf-line-arc/test.js
@@ -4,7 +4,7 @@ const path = require("path");
const load = require("load-json-file");
const write = require("write-json-file");
const truncate = require("@turf/truncate").default;
-const { featureCollection } = require("@turf/helpers");
+const { featureCollection, point } = require("@turf/helpers");
const lineArc = require("./index").default;
const directories = {
@@ -24,12 +24,54 @@ test("turf-line-arc", (t) => {
for (const { filename, name, geojson } of fixtures) {
const { radius, bearing1, bearing2, steps, units } = geojson.properties;
const arc = truncate(
- lineArc(geojson, radius, bearing1, bearing2, steps, units)
+ lineArc(geojson, radius, bearing1, bearing2, { steps, units })
);
const results = featureCollection([geojson, arc]);
-
if (process.env.REGEN) write.sync(directories.out + filename, results);
t.deepEquals(results, load.sync(directories.out + filename), name);
+ // Check the resulting arc geometry has the expected number of points.
+ // undefined or 0 steps should default to 64 + 1 points, 1 to 1 + 1,
+ // 2 to 2 + 1, ...
+ const expectedPoints = geojson.properties?.steps
+ ? geojson.properties?.steps + 1
+ : 64 + 1;
+ t.equals(
+ arc.geometry.coordinates.length,
+ expectedPoints,
+ `${name} number of points in arc`
+ );
}
t.end();
});
+
+test("turf-line-arc #2524", (t) => {
+ // Just test to make sure we're getting the correct number of points in the
+ // resultant arc i.e. steps + 1
+ const options = { steps: 10, units: "kilometers" };
+
+ const center = point([115.959444, -31.945]);
+ const startAngle = 223;
+ const endAngle = 277;
+ const radius = 130;
+ const arc = lineArc(center, radius, startAngle, endAngle, options);
+
+ t.equals(arc.geometry.coordinates.length, 10 + 1, "Number of points in arc");
+ t.end();
+});
+
+test("turf-line-arc #2446", (t) => {
+ // Test to make sure we're not getting an error, as described in
+ // https://github.com/Turfjs/turf/issues/2446
+ const options = { steps: 15, units: "kilometers" };
+
+ const center = point([115.959444, -31.945]);
+ const startAngle = 253;
+ const endAngle = 277;
+ const radius = 119.7195;
+
+ t.doesNotThrow(() =>
+ lineArc(center, radius * 1.852, startAngle, endAngle, options)
+ );
+
+ t.end();
+});
diff --git a/packages/turf-line-arc/test/in/line-arc-one-step.geojson b/packages/turf-line-arc/test/in/line-arc-one-step.geojson
new file mode 100644
index 000000000..e309c37ed
--- /dev/null
+++ b/packages/turf-line-arc/test/in/line-arc-one-step.geojson
@@ -0,0 +1,13 @@
+{
+ "type": "Feature",
+ "properties": {
+ "steps": 1,
+ "radius": 500,
+ "bearing1": 60,
+ "bearing2": 65
+ },
+ "geometry": {
+ "type": "Point",
+ "coordinates": [11.343, 44.495]
+ }
+}
diff --git a/packages/turf-line-arc/test/in/line-arc-zero-steps.geojson b/packages/turf-line-arc/test/in/line-arc-zero-steps.geojson
new file mode 100644
index 000000000..4d7ec246e
--- /dev/null
+++ b/packages/turf-line-arc/test/in/line-arc-zero-steps.geojson
@@ -0,0 +1,13 @@
+{
+ "type": "Feature",
+ "properties": {
+ "steps": 0,
+ "radius": 500,
+ "bearing1": 60,
+ "bearing2": 65
+ },
+ "geometry": {
+ "type": "Point",
+ "coordinates": [11.343, 44.495]
+ }
+}
diff --git a/packages/turf-line-arc/test/in/line-arc7.geojson b/packages/turf-line-arc/test/in/line-arc7.geojson
new file mode 100644
index 000000000..bf64b8847
--- /dev/null
+++ b/packages/turf-line-arc/test/in/line-arc7.geojson
@@ -0,0 +1,12 @@
+{
+ "type": "Feature",
+ "properties": {
+ "radius": 500,
+ "bearing1": 60,
+ "bearing2": 65
+ },
+ "geometry": {
+ "type": "Point",
+ "coordinates": [11.343, 44.495]
+ }
+}
diff --git a/packages/turf-line-arc/test/out/line-arc-greater-360.geojson b/packages/turf-line-arc/test/out/line-arc-greater-360.geojson
index 3c7302542..a22155c6a 100644
--- a/packages/turf-line-arc/test/out/line-arc-greater-360.geojson
+++ b/packages/turf-line-arc/test/out/line-arc-greater-360.geojson
@@ -24,9 +24,69 @@
"type": "LineString",
"coordinates": [
[11.343, 44.539966],
+ [11.343344, 44.539965],
+ [11.343688, 44.539963],
+ [11.344032, 44.53996],
+ [11.344376, 44.539955],
+ [11.34472, 44.539949],
+ [11.345064, 44.539942],
+ [11.345408, 44.539933],
+ [11.345752, 44.539923],
+ [11.346096, 44.539912],
+ [11.346439, 44.539899],
+ [11.346783, 44.539885],
+ [11.347126, 44.53987],
+ [11.347469, 44.539853],
+ [11.347813, 44.539835],
+ [11.348156, 44.539816],
+ [11.348498, 44.539795],
+ [11.348841, 44.539773],
[11.349184, 44.539749],
+ [11.349526, 44.539725],
+ [11.349868, 44.539699],
+ [11.35021, 44.539671],
+ [11.350552, 44.539642],
+ [11.350893, 44.539612],
+ [11.351234, 44.539581],
+ [11.351575, 44.539548],
+ [11.351916, 44.539514],
+ [11.352257, 44.539479],
+ [11.352597, 44.539442],
+ [11.352937, 44.539404],
+ [11.353276, 44.539365],
+ [11.353616, 44.539324],
+ [11.353955, 44.539282],
+ [11.354294, 44.539239],
+ [11.354632, 44.539194],
+ [11.35497, 44.539149],
[11.355307, 44.539101],
+ [11.355645, 44.539053],
+ [11.355982, 44.539003],
+ [11.356318, 44.538952],
+ [11.356654, 44.538899],
+ [11.35699, 44.538846],
+ [11.357325, 44.53879],
+ [11.35766, 44.538734],
+ [11.357995, 44.538676],
+ [11.358329, 44.538617],
+ [11.358662, 44.538557],
+ [11.358995, 44.538496],
+ [11.359328, 44.538433],
+ [11.35966, 44.538369],
+ [11.359991, 44.538303],
+ [11.360322, 44.538236],
+ [11.360653, 44.538168],
+ [11.360983, 44.538099],
[11.361313, 44.538028],
+ [11.361642, 44.537956],
+ [11.36197, 44.537883],
+ [11.362298, 44.537809],
+ [11.362625, 44.537733],
+ [11.362952, 44.537656],
+ [11.363278, 44.537578],
+ [11.363603, 44.537498],
+ [11.363928, 44.537418],
+ [11.364252, 44.537336],
[11.364576, 44.537252]
]
}
diff --git a/packages/turf-line-arc/test/out/line-arc-one-step.geojson b/packages/turf-line-arc/test/out/line-arc-one-step.geojson
new file mode 100644
index 000000000..aae28c16b
--- /dev/null
+++ b/packages/turf-line-arc/test/out/line-arc-one-step.geojson
@@ -0,0 +1,34 @@
+{
+ "type": "FeatureCollection",
+ "features": [
+ {
+ "type": "Feature",
+ "properties": {
+ "steps": 1,
+ "radius": 500,
+ "bearing1": 60,
+ "bearing2": 65
+ },
+ "geometry": {
+ "type": "Point",
+ "coordinates": [11.343, 44.495]
+ }
+ },
+ {
+ "type": "Feature",
+ "properties": {
+ "steps": 1,
+ "radius": 500,
+ "bearing1": 60,
+ "bearing2": 65
+ },
+ "geometry": {
+ "type": "LineString",
+ "coordinates": [
+ [17.014763, 46.606416],
+ [17.240322, 46.246701]
+ ]
+ }
+ }
+ ]
+}
diff --git a/packages/turf-line-arc/test/out/line-arc-zero-steps.geojson b/packages/turf-line-arc/test/out/line-arc-zero-steps.geojson
new file mode 100644
index 000000000..c43632b44
--- /dev/null
+++ b/packages/turf-line-arc/test/out/line-arc-zero-steps.geojson
@@ -0,0 +1,97 @@
+{
+ "type": "FeatureCollection",
+ "features": [
+ {
+ "type": "Feature",
+ "properties": {
+ "steps": 0,
+ "radius": 500,
+ "bearing1": 60,
+ "bearing2": 65
+ },
+ "geometry": {
+ "type": "Point",
+ "coordinates": [11.343, 44.495]
+ }
+ },
+ {
+ "type": "Feature",
+ "properties": {
+ "steps": 0,
+ "radius": 500,
+ "bearing1": 60,
+ "bearing2": 65
+ },
+ "geometry": {
+ "type": "LineString",
+ "coordinates": [
+ [17.014763, 46.606416],
+ [17.018658, 46.600907],
+ [17.022542, 46.595393],
+ [17.026413, 46.589876],
+ [17.030274, 46.584356],
+ [17.034122, 46.578831],
+ [17.037959, 46.573303],
+ [17.041784, 46.567771],
+ [17.045597, 46.562236],
+ [17.049399, 46.556697],
+ [17.053189, 46.551154],
+ [17.056967, 46.545607],
+ [17.060733, 46.540057],
+ [17.064488, 46.534503],
+ [17.068231, 46.528946],
+ [17.071962, 46.523385],
+ [17.075682, 46.51782],
+ [17.079389, 46.512252],
+ [17.083085, 46.50668],
+ [17.086769, 46.501105],
+ [17.090442, 46.495526],
+ [17.094102, 46.489943],
+ [17.097751, 46.484357],
+ [17.101388, 46.478768],
+ [17.105013, 46.473174],
+ [17.108627, 46.467578],
+ [17.112228, 46.461978],
+ [17.115818, 46.456374],
+ [17.119396, 46.450767],
+ [17.122963, 46.445157],
+ [17.126517, 46.439543],
+ [17.13006, 46.433925],
+ [17.133591, 46.428305],
+ [17.13711, 46.42268],
+ [17.140617, 46.417053],
+ [17.144112, 46.411422],
+ [17.147596, 46.405787],
+ [17.151068, 46.40015],
+ [17.154528, 46.394508],
+ [17.157976, 46.388864],
+ [17.161412, 46.383216],
+ [17.164836, 46.377565],
+ [17.168249, 46.371911],
+ [17.171649, 46.366253],
+ [17.175038, 46.360592],
+ [17.178415, 46.354928],
+ [17.18178, 46.34926],
+ [17.185134, 46.34359],
+ [17.188475, 46.337916],
+ [17.191805, 46.332238],
+ [17.195122, 46.326558],
+ [17.198428, 46.320874],
+ [17.201722, 46.315187],
+ [17.205004, 46.309497],
+ [17.208274, 46.303804],
+ [17.211533, 46.298108],
+ [17.214779, 46.292408],
+ [17.218013, 46.286706],
+ [17.221236, 46.281],
+ [17.224447, 46.275291],
+ [17.227646, 46.269579],
+ [17.230832, 46.263864],
+ [17.234007, 46.258146],
+ [17.237171, 46.252425],
+ [17.240322, 46.246701]
+ ]
+ }
+ }
+ ]
+}
diff --git a/packages/turf-line-arc/test/out/line-arc1.geojson b/packages/turf-line-arc/test/out/line-arc1.geojson
index 6e994aab2..85e64cac6 100644
--- a/packages/turf-line-arc/test/out/line-arc1.geojson
+++ b/packages/turf-line-arc/test/out/line-arc1.geojson
@@ -24,12 +24,68 @@
"type": "LineString",
"coordinates": [
[11.364576, 44.537252],
+ [11.365221, 44.537082],
+ [11.365864, 44.536906],
+ [11.366504, 44.536726],
+ [11.367141, 44.536541],
+ [11.367775, 44.53635],
+ [11.368406, 44.536155],
+ [11.369035, 44.535955],
+ [11.36966, 44.53575],
[11.370282, 44.53554],
+ [11.3709, 44.535325],
+ [11.371516, 44.535106],
+ [11.372128, 44.534882],
+ [11.372736, 44.534653],
+ [11.373341, 44.534419],
+ [11.373943, 44.53418],
+ [11.37454, 44.533937],
+ [11.375134, 44.53369],
[11.375724, 44.533437],
+ [11.37631, 44.53318],
+ [11.376893, 44.532919],
+ [11.377471, 44.532653],
+ [11.378045, 44.532383],
+ [11.378615, 44.532108],
+ [11.37918, 44.531828],
+ [11.379741, 44.531545],
+ [11.380298, 44.531257],
[11.380851, 44.530964],
+ [11.381399, 44.530668],
+ [11.381942, 44.530367],
+ [11.382481, 44.530062],
+ [11.383015, 44.529752],
+ [11.383544, 44.529439],
+ [11.384069, 44.529121],
+ [11.384588, 44.5288],
+ [11.385103, 44.528474],
[11.385612, 44.528145],
+ [11.386117, 44.527811],
+ [11.386616, 44.527474],
+ [11.38711, 44.527132],
+ [11.387599, 44.526787],
+ [11.388083, 44.526438],
+ [11.388561, 44.526086],
+ [11.389034, 44.525729],
+ [11.389501, 44.525369],
[11.389963, 44.525006],
+ [11.390419, 44.524638],
+ [11.390869, 44.524268],
+ [11.391314, 44.523893],
+ [11.391753, 44.523516],
+ [11.392186, 44.523135],
+ [11.392614, 44.52275],
+ [11.393035, 44.522363],
+ [11.393451, 44.521972],
[11.39386, 44.521578],
+ [11.394264, 44.52118],
+ [11.394661, 44.52078],
+ [11.395052, 44.520376],
+ [11.395437, 44.51997],
+ [11.395816, 44.51956],
+ [11.396188, 44.519148],
+ [11.396554, 44.518733],
+ [11.396914, 44.518314],
[11.397267, 44.517894],
[11.397614, 44.51747]
]
diff --git a/packages/turf-line-arc/test/out/line-arc2.geojson b/packages/turf-line-arc/test/out/line-arc2.geojson
index 549b40f5e..7c27ae39b 100644
--- a/packages/turf-line-arc/test/out/line-arc2.geojson
+++ b/packages/turf-line-arc/test/out/line-arc2.geojson
@@ -24,29 +24,69 @@
"type": "LineString",
"coordinates": [
[11.406038, 44.494983],
- [11.40573, 44.490575],
- [11.404818, 44.486211],
+ [11.405994, 44.493328],
+ [11.405864, 44.491675],
+ [11.405649, 44.490027],
+ [11.405349, 44.488385],
+ [11.404965, 44.486753],
+ [11.404496, 44.485131],
+ [11.403945, 44.483524],
[11.40331, 44.481931],
- [11.401223, 44.477777],
- [11.398575, 44.47379],
+ [11.402595, 44.480357],
+ [11.401798, 44.478802],
+ [11.400922, 44.477269],
+ [11.399967, 44.47576],
+ [11.398936, 44.474278],
+ [11.397828, 44.472823],
+ [11.396646, 44.471399],
[11.395392, 44.470006],
- [11.391706, 44.466464],
- [11.387551, 44.463196],
+ [11.394067, 44.468648],
+ [11.392673, 44.467325],
+ [11.391211, 44.466039],
+ [11.389684, 44.464793],
+ [11.388094, 44.463588],
+ [11.386443, 44.462425],
+ [11.384734, 44.461307],
[11.382967, 44.460234],
- [11.378, 44.457607],
- [11.372696, 44.45534],
+ [11.381147, 44.459208],
+ [11.379275, 44.458231],
+ [11.377354, 44.457303],
+ [11.375387, 44.456427],
+ [11.373376, 44.455603],
+ [11.371323, 44.454832],
+ [11.369233, 44.454115],
[11.367107, 44.453454],
- [11.361286, 44.451969],
- [11.355289, 44.450897],
+ [11.364948, 44.452849],
+ [11.36276, 44.452302],
+ [11.360544, 44.451812],
+ [11.358306, 44.451381],
+ [11.356046, 44.451008],
+ [11.353769, 44.450695],
+ [11.351477, 44.450443],
[11.349174, 44.45025],
- [11.343, 44.450034],
- [11.336826, 44.45025],
+ [11.346863, 44.450119],
+ [11.344546, 44.450048],
+ [11.342227, 44.450037],
+ [11.339909, 44.450088],
+ [11.337596, 44.4502],
+ [11.335289, 44.450372],
+ [11.332993, 44.450605],
[11.330711, 44.450897],
- [11.324714, 44.451969],
- [11.318893, 44.453454],
+ [11.328445, 44.45125],
+ [11.326199, 44.451662],
+ [11.323976, 44.452132],
+ [11.321778, 44.452661],
+ [11.31961, 44.453246],
+ [11.317472, 44.453889],
+ [11.315369, 44.454587],
[11.313304, 44.45534],
- [11.308, 44.457607],
- [11.303033, 44.460234],
+ [11.311279, 44.456146],
+ [11.309297, 44.457005],
+ [11.30736, 44.457916],
+ [11.305471, 44.458877],
+ [11.303634, 44.459887],
+ [11.301849, 44.460944],
+ [11.30012, 44.462047],
[11.298449, 44.463196]
]
}
diff --git a/packages/turf-line-arc/test/out/line-arc3.geojson b/packages/turf-line-arc/test/out/line-arc3.geojson
index 3dbbd0c9f..33911f2cc 100644
--- a/packages/turf-line-arc/test/out/line-arc3.geojson
+++ b/packages/turf-line-arc/test/out/line-arc3.geojson
@@ -24,53 +24,69 @@
"type": "LineString",
"coordinates": [
[11.387599, 44.526787],
- [11.391753, 44.523516],
- [11.395437, 44.51997],
+ [11.390757, 44.524361],
+ [11.393656, 44.521775],
+ [11.39628, 44.519044],
[11.398615, 44.516183],
- [11.401257, 44.512193],
- [11.403337, 44.508037],
+ [11.400648, 44.513208],
+ [11.402369, 44.510133],
+ [11.403767, 44.506977],
[11.404836, 44.503756],
- [11.40574, 44.49939],
- [11.406038, 44.494983],
+ [11.40557, 44.500487],
+ [11.405965, 44.497189],
+ [11.406018, 44.493879],
[11.40573, 44.490575],
- [11.404818, 44.486211],
- [11.40331, 44.481931],
+ [11.405102, 44.487296],
+ [11.404138, 44.484058],
+ [11.402842, 44.480879],
[11.401223, 44.477777],
- [11.398575, 44.47379],
- [11.395392, 44.470006],
+ [11.399288, 44.474769],
+ [11.397048, 44.47187],
+ [11.394516, 44.469097],
[11.391706, 44.466464],
- [11.387551, 44.463196],
- [11.382967, 44.460234],
+ [11.388631, 44.463985],
+ [11.38531, 44.461675],
+ [11.38176, 44.459545],
[11.378, 44.457607],
- [11.372696, 44.45534],
- [11.367107, 44.453454],
+ [11.374051, 44.455871],
+ [11.369934, 44.454348],
+ [11.365671, 44.453045],
[11.361286, 44.451969],
- [11.355289, 44.450897],
- [11.349174, 44.45025],
+ [11.356801, 44.451126],
+ [11.352243, 44.45052],
+ [11.347634, 44.450156],
[11.343, 44.450034],
- [11.336826, 44.45025],
- [11.330711, 44.450897],
+ [11.338366, 44.450156],
+ [11.333757, 44.45052],
+ [11.329199, 44.451126],
[11.324714, 44.451969],
- [11.318893, 44.453454],
- [11.313304, 44.45534],
+ [11.320329, 44.453045],
+ [11.316066, 44.454348],
+ [11.311949, 44.455871],
[11.308, 44.457607],
- [11.303033, 44.460234],
- [11.298449, 44.463196],
+ [11.30424, 44.459545],
+ [11.30069, 44.461675],
+ [11.297369, 44.463985],
[11.294294, 44.466464],
- [11.290608, 44.470006],
- [11.287425, 44.47379],
+ [11.291484, 44.469097],
+ [11.288952, 44.47187],
+ [11.286712, 44.474769],
[11.284777, 44.477777],
- [11.28269, 44.481931],
- [11.281182, 44.486211],
+ [11.283158, 44.480879],
+ [11.281862, 44.484058],
+ [11.280898, 44.487296],
[11.28027, 44.490575],
- [11.279962, 44.494983],
- [11.28026, 44.49939],
+ [11.279982, 44.493879],
+ [11.280035, 44.497189],
+ [11.28043, 44.500487],
[11.281164, 44.503756],
- [11.282663, 44.508037],
- [11.284743, 44.512193],
+ [11.282233, 44.506977],
+ [11.283631, 44.510133],
+ [11.285352, 44.513208],
[11.287385, 44.516183],
- [11.290563, 44.51997],
- [11.294247, 44.523516],
+ [11.28972, 44.519044],
+ [11.292344, 44.521775],
+ [11.295243, 44.524361],
[11.298401, 44.526787]
]
}
diff --git a/packages/turf-line-arc/test/out/line-arc4.geojson b/packages/turf-line-arc/test/out/line-arc4.geojson
index 07450bbff..ca1afface 100644
--- a/packages/turf-line-arc/test/out/line-arc4.geojson
+++ b/packages/turf-line-arc/test/out/line-arc4.geojson
@@ -24,12 +24,69 @@
"type": "LineString",
"coordinates": [
[11.294686, 44.523893],
- [11.29889, 44.527132],
- [11.303519, 44.530062],
- [11.308529, 44.532653],
- [11.313872, 44.534882],
- [11.319496, 44.536726],
- [11.325347, 44.538168],
+ [11.295075, 44.524221],
+ [11.295468, 44.524546],
+ [11.295866, 44.524868],
+ [11.296267, 44.525188],
+ [11.296674, 44.525505],
+ [11.297084, 44.525819],
+ [11.297499, 44.52613],
+ [11.297917, 44.526438],
+ [11.29834, 44.526744],
+ [11.298767, 44.527046],
+ [11.299198, 44.527346],
+ [11.299633, 44.527643],
+ [11.300072, 44.527937],
+ [11.300515, 44.528227],
+ [11.300961, 44.528515],
+ [11.301412, 44.5288],
+ [11.301866, 44.529081],
+ [11.302324, 44.52936],
+ [11.302786, 44.529635],
+ [11.303251, 44.529907],
+ [11.303721, 44.530176],
+ [11.304193, 44.530442],
+ [11.304669, 44.530705],
+ [11.305149, 44.530964],
+ [11.305632, 44.53122],
+ [11.306119, 44.531473],
+ [11.306609, 44.531722],
+ [11.307102, 44.531969],
+ [11.307599, 44.532211],
+ [11.308098, 44.532451],
+ [11.308601, 44.532686],
+ [11.309107, 44.532919],
+ [11.309617, 44.533148],
+ [11.310129, 44.533374],
+ [11.310644, 44.533596],
+ [11.311162, 44.533814],
+ [11.311683, 44.534029],
+ [11.312207, 44.534241],
+ [11.312734, 44.534448],
+ [11.313264, 44.534653],
+ [11.313796, 44.534853],
+ [11.314331, 44.53505],
+ [11.314868, 44.535244],
+ [11.315408, 44.535433],
+ [11.315951, 44.535619],
+ [11.316496, 44.535802],
+ [11.317044, 44.53598],
+ [11.317594, 44.536155],
+ [11.318146, 44.536326],
+ [11.3187, 44.536494],
+ [11.319257, 44.536657],
+ [11.319816, 44.536817],
+ [11.320377, 44.536973],
+ [11.32094, 44.537125],
+ [11.321505, 44.537273],
+ [11.322072, 44.537418],
+ [11.322641, 44.537558],
+ [11.323212, 44.537695],
+ [11.323784, 44.537828],
+ [11.324358, 44.537956],
+ [11.324934, 44.538081],
+ [11.325512, 44.538202],
+ [11.326091, 44.53832],
[11.326672, 44.538433]
]
}
diff --git a/packages/turf-line-arc/test/out/line-arc5.geojson b/packages/turf-line-arc/test/out/line-arc5.geojson
index 22a813532..5f6dfc5d5 100644
--- a/packages/turf-line-arc/test/out/line-arc5.geojson
+++ b/packages/turf-line-arc/test/out/line-arc5.geojson
@@ -24,63 +24,69 @@
"type": "LineString",
"coordinates": [
[11.326672, 44.538433],
- [11.332724, 44.539365],
- [11.338874, 44.53987],
- [11.345064, 44.539942],
- [11.351234, 44.539581],
- [11.357325, 44.53879],
- [11.363278, 44.537578],
- [11.369035, 44.535955],
- [11.37454, 44.533937],
- [11.379741, 44.531545],
- [11.384588, 44.5288],
- [11.389034, 44.525729],
- [11.393035, 44.522363],
- [11.396554, 44.518733],
- [11.399557, 44.514874],
- [11.402014, 44.510824],
- [11.403903, 44.506622],
- [11.405204, 44.502308],
- [11.405907, 44.497924],
- [11.406003, 44.493511],
- [11.405493, 44.489114],
- [11.404381, 44.484773],
- [11.402678, 44.480531],
- [11.400401, 44.476428],
- [11.397572, 44.472504],
- [11.394218, 44.468797],
- [11.390371, 44.465342],
- [11.386068, 44.462173],
- [11.381352, 44.45932],
- [11.376267, 44.45681],
- [11.370862, 44.454668],
- [11.365189, 44.452914],
- [11.359303, 44.451565],
- [11.353261, 44.450634],
- [11.34712, 44.45013],
- [11.340939, 44.450058],
- [11.334778, 44.450418],
- [11.328696, 44.451208],
- [11.322752, 44.452419],
- [11.317002, 44.454039],
- [11.311502, 44.456054],
- [11.306305, 44.458444],
- [11.30146, 44.461185],
- [11.297015, 44.464252],
- [11.293012, 44.467616],
- [11.289489, 44.471242],
- [11.286482, 44.475098],
- [11.284018, 44.479146],
- [11.282122, 44.483346],
- [11.280811, 44.487658],
- [11.2801, 44.492042],
- [11.279994, 44.496454],
- [11.280495, 44.500852],
- [11.281598, 44.505194],
- [11.283292, 44.509438],
- [11.285562, 44.513543],
- [11.288386, 44.51747],
- [11.291736, 44.52118],
+ [11.33213, 44.539293],
+ [11.337673, 44.539805],
+ [11.343258, 44.539966],
+ [11.348841, 44.539773],
+ [11.354378, 44.539228],
+ [11.359826, 44.538336],
+ [11.365141, 44.537103],
+ [11.370282, 44.53554],
+ [11.375208, 44.533658],
+ [11.379881, 44.531473],
+ [11.384264, 44.529001],
+ [11.388323, 44.526262],
+ [11.392025, 44.523278],
+ [11.395341, 44.520072],
+ [11.398247, 44.516669],
+ [11.400718, 44.513095],
+ [11.402735, 44.50938],
+ [11.404284, 44.505552],
+ [11.405351, 44.501642],
+ [11.405928, 44.497679],
+ [11.406011, 44.493695],
+ [11.4056, 44.489722],
+ [11.404697, 44.48579],
+ [11.40331, 44.481931],
+ [11.401451, 44.478175],
+ [11.399132, 44.47455],
+ [11.396374, 44.471086],
+ [11.393197, 44.46781],
+ [11.389626, 44.464748],
+ [11.385691, 44.461923],
+ [11.38142, 44.459357],
+ [11.376848, 44.457071],
+ [11.372012, 44.455083],
+ [11.366948, 44.453408],
+ [11.361696, 44.452059],
+ [11.356298, 44.451047],
+ [11.350796, 44.450379],
+ [11.345233, 44.450062],
+ [11.339652, 44.450097],
+ [11.334097, 44.450485],
+ [11.328613, 44.451222],
+ [11.32324, 44.452302],
+ [11.318023, 44.453717],
+ [11.313001, 44.455456],
+ [11.308215, 44.457505],
+ [11.303701, 44.459848],
+ [11.299495, 44.462468],
+ [11.295629, 44.465342],
+ [11.292135, 44.468449],
+ [11.28904, 44.471765],
+ [11.286368, 44.475263],
+ [11.28414, 44.478916],
+ [11.282374, 44.482696],
+ [11.281083, 44.486572],
+ [11.280278, 44.490514],
+ [11.279966, 44.494492],
+ [11.280148, 44.498474],
+ [11.280824, 44.502429],
+ [11.281988, 44.506325],
+ [11.283631, 44.510133],
+ [11.285741, 44.513822],
+ [11.2883, 44.517364],
+ [11.29129, 44.52073],
[11.294686, 44.523893]
]
}
diff --git a/packages/turf-line-arc/test/out/line-arc6.geojson b/packages/turf-line-arc/test/out/line-arc6.geojson
index 6db88b05c..46d44a0ff 100644
--- a/packages/turf-line-arc/test/out/line-arc6.geojson
+++ b/packages/turf-line-arc/test/out/line-arc6.geojson
@@ -24,61 +24,68 @@
"type": "LineString",
"coordinates": [
[11.397614, 44.51747],
- [11.400438, 44.513543],
- [11.402708, 44.509438],
- [11.404402, 44.505194],
- [11.405505, 44.500852],
- [11.406006, 44.496454],
- [11.4059, 44.492042],
- [11.405189, 44.487658],
+ [11.400151, 44.513989],
+ [11.402252, 44.510364],
+ [11.403903, 44.506622],
+ [11.405089, 44.502791],
+ [11.405803, 44.498902],
+ [11.406038, 44.494983],
+ [11.405794, 44.491064],
+ [11.405072, 44.487175],
[11.403878, 44.483346],
- [11.401982, 44.479146],
- [11.399518, 44.475098],
- [11.396511, 44.471242],
- [11.392988, 44.467616],
- [11.388985, 44.464252],
- [11.38454, 44.461185],
- [11.379695, 44.458444],
+ [11.402221, 44.479605],
+ [11.400114, 44.475982],
+ [11.397572, 44.472504],
+ [11.394615, 44.469197],
+ [11.391266, 44.466086],
+ [11.387551, 44.463196],
+ [11.383496, 44.460547],
+ [11.379135, 44.45816],
[11.374498, 44.456054],
- [11.368998, 44.454039],
- [11.363248, 44.452419],
- [11.357304, 44.451208],
- [11.351222, 44.450418],
- [11.345061, 44.450058],
- [11.33888, 44.45013],
- [11.332739, 44.450634],
+ [11.369623, 44.454244],
+ [11.364545, 44.452744],
+ [11.359303, 44.451565],
+ [11.353938, 44.450717],
+ [11.34849, 44.450205],
+ [11.343, 44.450034],
+ [11.33751, 44.450205],
+ [11.332062, 44.450717],
[11.326697, 44.451565],
- [11.320811, 44.452914],
- [11.315138, 44.454668],
- [11.309733, 44.45681],
- [11.304648, 44.45932],
- [11.299932, 44.462173],
- [11.295629, 44.465342],
- [11.291782, 44.468797],
+ [11.321455, 44.452744],
+ [11.316377, 44.454244],
+ [11.311502, 44.456054],
+ [11.306865, 44.45816],
+ [11.302504, 44.460547],
+ [11.298449, 44.463196],
+ [11.294734, 44.466086],
+ [11.291385, 44.469197],
[11.288428, 44.472504],
- [11.285599, 44.476428],
- [11.283322, 44.480531],
- [11.281619, 44.484773],
- [11.280507, 44.489114],
- [11.279997, 44.493511],
- [11.280093, 44.497924],
- [11.280796, 44.502308],
+ [11.285886, 44.475982],
+ [11.283779, 44.479605],
+ [11.282122, 44.483346],
+ [11.280928, 44.487175],
+ [11.280206, 44.491064],
+ [11.279962, 44.494983],
+ [11.280197, 44.498902],
+ [11.280911, 44.502791],
[11.282097, 44.506622],
- [11.283986, 44.510824],
- [11.286443, 44.514874],
- [11.289446, 44.518733],
- [11.292965, 44.522363],
- [11.296966, 44.525729],
- [11.301412, 44.5288],
- [11.306259, 44.531545],
+ [11.283748, 44.510364],
+ [11.285849, 44.513989],
+ [11.288386, 44.51747],
+ [11.291339, 44.52078],
+ [11.294686, 44.523893],
+ [11.298401, 44.526787],
+ [11.302456, 44.529439],
+ [11.30682, 44.531828],
[11.31146, 44.533937],
- [11.316965, 44.535955],
- [11.322722, 44.537578],
- [11.328675, 44.53879],
- [11.334766, 44.539581],
- [11.340936, 44.539942],
- [11.347126, 44.53987],
- [11.353276, 44.539365],
+ [11.31634, 44.53575],
+ [11.321424, 44.537252],
+ [11.326672, 44.538433],
+ [11.332045, 44.539282],
+ [11.337502, 44.539795],
+ [11.343, 44.539966],
+ [11.348498, 44.539795],
+ [11.353955, 44.539282],
[11.359328, 44.538433],
[11.364576, 44.537252]
]
diff --git a/packages/turf-line-arc/test/out/line-arc7.geojson b/packages/turf-line-arc/test/out/line-arc7.geojson
new file mode 100644
index 000000000..ede108173
--- /dev/null
+++ b/packages/turf-line-arc/test/out/line-arc7.geojson
@@ -0,0 +1,95 @@
+{
+ "type": "FeatureCollection",
+ "features": [
+ {
+ "type": "Feature",
+ "properties": {
+ "radius": 500,
+ "bearing1": 60,
+ "bearing2": 65
+ },
+ "geometry": {
+ "type": "Point",
+ "coordinates": [11.343, 44.495]
+ }
+ },
+ {
+ "type": "Feature",
+ "properties": {
+ "radius": 500,
+ "bearing1": 60,
+ "bearing2": 65
+ },
+ "geometry": {
+ "type": "LineString",
+ "coordinates": [
+ [17.014763, 46.606416],
+ [17.018658, 46.600907],
+ [17.022542, 46.595393],
+ [17.026413, 46.589876],
+ [17.030274, 46.584356],
+ [17.034122, 46.578831],
+ [17.037959, 46.573303],
+ [17.041784, 46.567771],
+ [17.045597, 46.562236],
+ [17.049399, 46.556697],
+ [17.053189, 46.551154],
+ [17.056967, 46.545607],
+ [17.060733, 46.540057],
+ [17.064488, 46.534503],
+ [17.068231, 46.528946],
+ [17.071962, 46.523385],
+ [17.075682, 46.51782],
+ [17.079389, 46.512252],
+ [17.083085, 46.50668],
+ [17.086769, 46.501105],
+ [17.090442, 46.495526],
+ [17.094102, 46.489943],
+ [17.097751, 46.484357],
+ [17.101388, 46.478768],
+ [17.105013, 46.473174],
+ [17.108627, 46.467578],
+ [17.112228, 46.461978],
+ [17.115818, 46.456374],
+ [17.119396, 46.450767],
+ [17.122963, 46.445157],
+ [17.126517, 46.439543],
+ [17.13006, 46.433925],
+ [17.133591, 46.428305],
+ [17.13711, 46.42268],
+ [17.140617, 46.417053],
+ [17.144112, 46.411422],
+ [17.147596, 46.405787],
+ [17.151068, 46.40015],
+ [17.154528, 46.394508],
+ [17.157976, 46.388864],
+ [17.161412, 46.383216],
+ [17.164836, 46.377565],
+ [17.168249, 46.371911],
+ [17.171649, 46.366253],
+ [17.175038, 46.360592],
+ [17.178415, 46.354928],
+ [17.18178, 46.34926],
+ [17.185134, 46.34359],
+ [17.188475, 46.337916],
+ [17.191805, 46.332238],
+ [17.195122, 46.326558],
+ [17.198428, 46.320874],
+ [17.201722, 46.315187],
+ [17.205004, 46.309497],
+ [17.208274, 46.303804],
+ [17.211533, 46.298108],
+ [17.214779, 46.292408],
+ [17.218013, 46.286706],
+ [17.221236, 46.281],
+ [17.224447, 46.275291],
+ [17.227646, 46.269579],
+ [17.230832, 46.263864],
+ [17.234007, 46.258146],
+ [17.237171, 46.252425],
+ [17.240322, 46.246701]
+ ]
+ }
+ }
+ ]
+}
diff --git a/packages/turf-line-chunk/package.json b/packages/turf-line-chunk/package.json
index c4fabed85..5dd2d245a 100644
--- a/packages/turf-line-chunk/package.json
+++ b/packages/turf-line-chunk/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/line-chunk",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf line-chunk module",
"author": "Turf Authors",
"contributors": [
@@ -46,26 +46,27 @@
"index.d.ts"
],
"scripts": {
- "bench": "node -r esm bench.js",
+ "bench": "tsx bench.js",
"build": "rollup -c ../../rollup.config.js && echo '{\"type\":\"module\"}' > dist/es/package.json",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "node -r esm test.js",
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js",
"test:types": "tsc --esModuleInterop --noEmit --strict types.ts"
},
"devDependencies": {
- "@turf/truncate": "^7.0.0-alpha.0",
+ "@turf/truncate": "^7.0.0-alpha.2",
"benchmark": "*",
"load-json-file": "*",
"npm-run-all": "*",
"rollup": "*",
"tape": "*",
+ "tsx": "*",
"write-json-file": "*"
},
"dependencies": {
- "@turf/helpers": "^7.0.0-alpha.0",
- "@turf/length": "^7.0.0-alpha.0",
- "@turf/line-slice-along": "^7.0.0-alpha.0",
- "@turf/meta": "^7.0.0-alpha.0"
+ "@turf/helpers": "^7.0.0-alpha.2",
+ "@turf/length": "^7.0.0-alpha.2",
+ "@turf/line-slice-along": "^7.0.0-alpha.2",
+ "@turf/meta": "^7.0.0-alpha.2"
}
}
diff --git a/packages/turf-line-intersect/index.ts b/packages/turf-line-intersect/index.ts
index ced3c84f6..fdffb1980 100644
--- a/packages/turf-line-intersect/index.ts
+++ b/packages/turf-line-intersect/index.ts
@@ -30,7 +30,7 @@ import findIntersections, { Intersection } from "sweepline-intersections";
*/
function lineIntersect<
G1 extends LineString | MultiLineString | Polygon | MultiPolygon,
- G2 extends LineString | MultiLineString | Polygon | MultiPolygon
+ G2 extends LineString | MultiLineString | Polygon | MultiPolygon,
>(
line1: FeatureCollection | Feature | G1,
line2: FeatureCollection | Feature | G2,
diff --git a/packages/turf-line-intersect/package.json b/packages/turf-line-intersect/package.json
index 544fc8e6c..f37c2759a 100644
--- a/packages/turf-line-intersect/package.json
+++ b/packages/turf-line-intersect/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/line-intersect",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf line-intersect module",
"author": "Turf Authors",
"contributors": [
@@ -32,7 +32,7 @@
"exports": {
"./package.json": "./package.json",
".": {
- "types": "./index.d.ts",
+ "types": "./dist/js/index.d.ts",
"import": "./dist/es/index.js",
"require": "./dist/js/index.js"
}
@@ -43,28 +43,27 @@
"dist"
],
"scripts": {
- "bench": "ts-node bench.js",
- "build": "npm-run-all build:*",
+ "bench": "tsx bench.js",
+ "build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "ts-node -r esm test.js"
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js"
},
"devDependencies": {
- "@turf/truncate": "^7.0.0-alpha.0",
+ "@turf/truncate": "^7.0.0-alpha.2",
"@types/tape": "*",
"benchmark": "*",
"load-json-file": "*",
"npm-run-all": "*",
"tape": "*",
- "ts-node": "*",
- "tslint": "*",
+ "tsx": "*",
"typescript": "*",
"write-json-file": "*"
},
"dependencies": {
- "@turf/helpers": "^7.0.0-alpha.0",
+ "@turf/helpers": "^7.0.0-alpha.2",
"sweepline-intersections": "^1.4.0",
"tslib": "^2.3.0"
}
diff --git a/packages/turf-line-offset/package.json b/packages/turf-line-offset/package.json
index f4fbdec17..5c47b2a71 100644
--- a/packages/turf-line-offset/package.json
+++ b/packages/turf-line-offset/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/line-offset",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf line-offset module",
"author": "Turf Authors",
"contributors": [
@@ -44,25 +44,26 @@
"index.d.ts"
],
"scripts": {
- "bench": "node -r esm bench.js",
+ "bench": "tsx bench.js",
"build": "rollup -c ../../rollup.config.js && echo '{\"type\":\"module\"}' > dist/es/package.json",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "node -r esm test.js",
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js",
"test:types": "tsc --esModuleInterop --noEmit --strict types.ts"
},
"devDependencies": {
- "@turf/truncate": "^7.0.0-alpha.0",
+ "@turf/truncate": "^7.0.0-alpha.2",
"benchmark": "*",
"load-json-file": "*",
"npm-run-all": "*",
"rollup": "*",
"tape": "*",
+ "tsx": "*",
"write-json-file": "*"
},
"dependencies": {
- "@turf/helpers": "^7.0.0-alpha.0",
- "@turf/invariant": "^7.0.0-alpha.0",
- "@turf/meta": "^7.0.0-alpha.0"
+ "@turf/helpers": "^7.0.0-alpha.2",
+ "@turf/invariant": "^7.0.0-alpha.2",
+ "@turf/meta": "^7.0.0-alpha.2"
}
}
diff --git a/packages/turf-line-overlap/index.ts b/packages/turf-line-overlap/index.ts
index 2d503ff9a..d9f07594a 100644
--- a/packages/turf-line-overlap/index.ts
+++ b/packages/turf-line-overlap/index.ts
@@ -36,7 +36,7 @@ import equal from "deep-equal";
*/
function lineOverlap<
G1 extends LineString | MultiLineString | Polygon | MultiPolygon,
- G2 extends LineString | MultiLineString | Polygon | MultiPolygon
+ G2 extends LineString | MultiLineString | Polygon | MultiPolygon,
>(
line1: Feature | G1,
line2: Feature | G2,
diff --git a/packages/turf-line-overlap/package.json b/packages/turf-line-overlap/package.json
index cf4a7a503..384e08442 100644
--- a/packages/turf-line-overlap/package.json
+++ b/packages/turf-line-overlap/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/line-overlap",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf line-overlap module",
"author": "Turf Authors",
"contributors": [
@@ -31,7 +31,7 @@
"exports": {
"./package.json": "./package.json",
".": {
- "types": "./index.d.ts",
+ "types": "./dist/js/index.d.ts",
"import": "./dist/es/index.js",
"require": "./dist/js/index.js"
}
@@ -42,13 +42,13 @@
"dist"
],
"scripts": {
- "bench": "ts-node bench.js",
- "build": "npm-run-all build:*",
+ "bench": "tsx bench.js",
+ "build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "ts-node -r esm test.js",
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js",
"test:types": "tsc --esModuleInterop --noEmit --strict types.ts"
},
"devDependencies": {
@@ -58,19 +58,18 @@
"load-json-file": "*",
"npm-run-all": "*",
"tape": "*",
- "ts-node": "*",
- "tslint": "*",
+ "tsx": "*",
"typescript": "*",
"write-json-file": "*"
},
"dependencies": {
- "@turf/boolean-point-on-line": "^7.0.0-alpha.0",
+ "@turf/boolean-point-on-line": "^7.0.0-alpha.2",
"@turf/geojson-rbush": "^3.2.0",
- "@turf/helpers": "^7.0.0-alpha.0",
- "@turf/invariant": "^7.0.0-alpha.0",
- "@turf/line-segment": "^7.0.0-alpha.0",
- "@turf/meta": "^7.0.0-alpha.0",
- "@turf/nearest-point-on-line": "^7.0.0-alpha.0",
+ "@turf/helpers": "^7.0.0-alpha.2",
+ "@turf/invariant": "^7.0.0-alpha.2",
+ "@turf/line-segment": "^7.0.0-alpha.2",
+ "@turf/meta": "^7.0.0-alpha.2",
+ "@turf/nearest-point-on-line": "^7.0.0-alpha.2",
"deep-equal": "1.x",
"tslib": "^2.3.0"
}
diff --git a/packages/turf-line-segment/index.ts b/packages/turf-line-segment/index.ts
index 68b0c138f..4d40d29c1 100644
--- a/packages/turf-line-segment/index.ts
+++ b/packages/turf-line-segment/index.ts
@@ -26,7 +26,7 @@ import { flattenEach } from "@turf/meta";
* var addToMap = [polygon, segments]
*/
function lineSegment<
- G extends LineString | MultiLineString | Polygon | MultiPolygon
+ G extends LineString | MultiLineString | Polygon | MultiPolygon,
>(
geojson: Feature | FeatureCollection | G
): FeatureCollection {
diff --git a/packages/turf-line-segment/package.json b/packages/turf-line-segment/package.json
index d5fe1ca8a..d4028dd2e 100644
--- a/packages/turf-line-segment/package.json
+++ b/packages/turf-line-segment/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/line-segment",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf line-segment module",
"author": "Turf Authors",
"license": "MIT",
@@ -26,7 +26,7 @@
"exports": {
"./package.json": "./package.json",
".": {
- "types": "./index.d.ts",
+ "types": "./dist/js/index.d.ts",
"import": "./dist/es/index.js",
"require": "./dist/js/index.js"
}
@@ -37,13 +37,13 @@
"dist"
],
"scripts": {
- "bench": "ts-node bench.js",
- "build": "npm-run-all build:*",
+ "bench": "tsx bench.js",
+ "build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "ts-node -r esm test.js"
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js"
},
"devDependencies": {
"@types/tape": "*",
@@ -51,15 +51,14 @@
"load-json-file": "*",
"npm-run-all": "*",
"tape": "*",
- "ts-node": "*",
- "tslint": "*",
+ "tsx": "*",
"typescript": "*",
"write-json-file": "*"
},
"dependencies": {
- "@turf/helpers": "^7.0.0-alpha.0",
- "@turf/invariant": "^7.0.0-alpha.0",
- "@turf/meta": "^7.0.0-alpha.0",
+ "@turf/helpers": "^7.0.0-alpha.2",
+ "@turf/invariant": "^7.0.0-alpha.2",
+ "@turf/meta": "^7.0.0-alpha.2",
"tslib": "^2.3.0"
}
}
diff --git a/packages/turf-line-slice-along/package.json b/packages/turf-line-slice-along/package.json
index 624d03a36..300713cf7 100644
--- a/packages/turf-line-slice-along/package.json
+++ b/packages/turf-line-slice-along/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/line-slice-along",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf line-slice-along module",
"author": "Turf Authors",
"license": "MIT",
@@ -38,24 +38,25 @@
"index.d.ts"
],
"scripts": {
- "bench": "node -r esm bench.js",
+ "bench": "tsx bench.js",
"build": "rollup -c ../../rollup.config.js && echo '{\"type\":\"module\"}' > dist/es/package.json",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "node -r esm test.js"
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js"
},
"devDependencies": {
- "@turf/along": "^7.0.0-alpha.0",
+ "@turf/along": "^7.0.0-alpha.2",
"benchmark": "*",
"load-json-file": "*",
"npm-run-all": "*",
"rollup": "*",
- "tape": "*"
+ "tape": "*",
+ "tsx": "*"
},
"dependencies": {
- "@turf/bearing": "^7.0.0-alpha.0",
- "@turf/destination": "^7.0.0-alpha.0",
- "@turf/distance": "^7.0.0-alpha.0",
- "@turf/helpers": "^7.0.0-alpha.0"
+ "@turf/bearing": "^7.0.0-alpha.2",
+ "@turf/destination": "^7.0.0-alpha.2",
+ "@turf/distance": "^7.0.0-alpha.2",
+ "@turf/helpers": "^7.0.0-alpha.2"
}
}
diff --git a/packages/turf-line-slice/bench.js b/packages/turf-line-slice/bench.js
index 442f28fb5..c0e0c07ed 100644
--- a/packages/turf-line-slice/bench.js
+++ b/packages/turf-line-slice/bench.js
@@ -7,7 +7,7 @@ var route1 = JSON.parse(fs.readFileSync(__dirname + "/test/in/route1.geojson"));
var route2 = JSON.parse(fs.readFileSync(__dirname + "/test/in/route2.geojson"));
var line1 = JSON.parse(fs.readFileSync(__dirname + "/test/in/line1.geojson"));
-var start1 = point([-97.79617309570312, 22.254624939561698]);
+var start1 = point([-97.79617309570313, 22.254624939561698]);
var stop1 = point([-97.72750854492188, 22.057641623615734]);
var start2 = point([-79.0850830078125, 37.60117623656667]);
var stop2 = point([-77.7667236328125, 38.65119833229951]);
diff --git a/packages/turf-line-slice/package.json b/packages/turf-line-slice/package.json
index 1e4fd7d1d..1a6cfc013 100644
--- a/packages/turf-line-slice/package.json
+++ b/packages/turf-line-slice/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/line-slice",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf line-slice module",
"author": "Turf Authors",
"license": "MIT",
@@ -42,24 +42,25 @@
"index.d.ts"
],
"scripts": {
- "bench": "node -r esm bench.js",
+ "bench": "tsx bench.js",
"build": "rollup -c ../../rollup.config.js && echo '{\"type\":\"module\"}' > dist/es/package.json",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "node -r esm test.js"
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js"
},
"devDependencies": {
- "@turf/truncate": "^7.0.0-alpha.0",
+ "@turf/truncate": "^7.0.0-alpha.2",
"benchmark": "*",
"load-json-file": "*",
"npm-run-all": "*",
"rollup": "*",
"tape": "*",
+ "tsx": "*",
"write-json-file": "*"
},
"dependencies": {
- "@turf/helpers": "^7.0.0-alpha.0",
- "@turf/invariant": "^7.0.0-alpha.0",
- "@turf/nearest-point-on-line": "^7.0.0-alpha.0"
+ "@turf/helpers": "^7.0.0-alpha.2",
+ "@turf/invariant": "^7.0.0-alpha.2",
+ "@turf/nearest-point-on-line": "^7.0.0-alpha.2"
}
}
diff --git a/packages/turf-line-split/package.json b/packages/turf-line-split/package.json
index f0d5a70e9..5fb948126 100644
--- a/packages/turf-line-split/package.json
+++ b/packages/turf-line-split/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/line-split",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf line-split module",
"author": "Turf Authors",
"contributors": [
@@ -43,11 +43,11 @@
"index.d.ts"
],
"scripts": {
- "bench": "node -r esm bench.js",
+ "bench": "tsx bench.js",
"build": "rollup -c ../../rollup.config.js && echo '{\"type\":\"module\"}' > dist/es/package.json",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "node -r esm test.js"
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js"
},
"devDependencies": {
"benchmark": "*",
@@ -55,18 +55,19 @@
"npm-run-all": "*",
"rollup": "*",
"tape": "*",
+ "tsx": "*",
"write-json-file": "*"
},
"dependencies": {
- "@turf/bbox": "^7.0.0-alpha.0",
+ "@turf/bbox": "^7.0.0-alpha.2",
"@turf/geojson-rbush": "^3.2.0",
- "@turf/helpers": "^7.0.0-alpha.0",
- "@turf/invariant": "^7.0.0-alpha.0",
- "@turf/line-intersect": "^7.0.0-alpha.0",
- "@turf/line-segment": "^7.0.0-alpha.0",
- "@turf/meta": "^7.0.0-alpha.0",
- "@turf/nearest-point-on-line": "^7.0.0-alpha.0",
- "@turf/square": "^7.0.0-alpha.0",
- "@turf/truncate": "^7.0.0-alpha.0"
+ "@turf/helpers": "^7.0.0-alpha.2",
+ "@turf/invariant": "^7.0.0-alpha.2",
+ "@turf/line-intersect": "^7.0.0-alpha.2",
+ "@turf/line-segment": "^7.0.0-alpha.2",
+ "@turf/meta": "^7.0.0-alpha.2",
+ "@turf/nearest-point-on-line": "^7.0.0-alpha.2",
+ "@turf/square": "^7.0.0-alpha.2",
+ "@turf/truncate": "^7.0.0-alpha.2"
}
}
diff --git a/packages/turf-line-to-polygon/package.json b/packages/turf-line-to-polygon/package.json
index fa58897f3..7d64423be 100644
--- a/packages/turf-line-to-polygon/package.json
+++ b/packages/turf-line-to-polygon/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/line-to-polygon",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf line-to-polygon module",
"author": "Turf Authors",
"contributors": [
@@ -31,7 +31,7 @@
"exports": {
"./package.json": "./package.json",
".": {
- "types": "./index.d.ts",
+ "types": "./dist/js/index.d.ts",
"import": "./dist/es/index.js",
"require": "./dist/js/index.js"
}
@@ -42,13 +42,13 @@
"dist"
],
"scripts": {
- "bench": "ts-node bench.js",
- "build": "npm-run-all build:*",
+ "bench": "tsx bench.js",
+ "build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "ts-node -r esm test.js",
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js",
"test:types": "tsc --esModuleInterop --noEmit --strict types.ts"
},
"devDependencies": {
@@ -57,16 +57,15 @@
"load-json-file": "*",
"npm-run-all": "*",
"tape": "*",
- "ts-node": "*",
- "tslint": "*",
+ "tsx": "*",
"typescript": "*",
"write-json-file": "*"
},
"dependencies": {
- "@turf/bbox": "^7.0.0-alpha.0",
- "@turf/clone": "^7.0.0-alpha.0",
- "@turf/helpers": "^7.0.0-alpha.0",
- "@turf/invariant": "^7.0.0-alpha.0",
+ "@turf/bbox": "^7.0.0-alpha.2",
+ "@turf/clone": "^7.0.0-alpha.2",
+ "@turf/helpers": "^7.0.0-alpha.2",
+ "@turf/invariant": "^7.0.0-alpha.2",
"tslib": "^2.3.0"
}
}
diff --git a/packages/turf-mask/package.json b/packages/turf-mask/package.json
index 875125cea..52e823de1 100644
--- a/packages/turf-mask/package.json
+++ b/packages/turf-mask/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/mask",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf mask module",
"author": "Turf Authors",
"license": "MIT",
@@ -38,11 +38,11 @@
"index.d.ts"
],
"scripts": {
- "bench": "node -r esm bench.js",
+ "bench": "tsx bench.js",
"build": "rollup -c ../../rollup.config.js && echo '{\"type\":\"module\"}' > dist/es/package.json",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "node -r esm test.js",
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js",
"test:types": "tsc --esModuleInterop --noEmit --strict types.ts"
},
"devDependencies": {
@@ -52,10 +52,11 @@
"npm-run-all": "*",
"rollup": "*",
"tape": "*",
+ "tsx": "*",
"write-json-file": "*"
},
"dependencies": {
- "@turf/helpers": "^7.0.0-alpha.0",
+ "@turf/helpers": "^7.0.0-alpha.2",
"polygon-clipping": "^0.15.3"
}
}
diff --git a/packages/turf-meta/index.d.ts b/packages/turf-meta/index.d.ts
index c66be624b..163587ea9 100644
--- a/packages/turf-meta/index.d.ts
+++ b/packages/turf-meta/index.d.ts
@@ -17,7 +17,7 @@ import { AllGeoJSON, Lines, Id } from "@turf/helpers";
/**
* http://turfjs.org/docs/#coordreduce
*/
-export function coordReduce(
+export function coordReduce(
geojson: AllGeoJSON,
callback: (
previousValue: Reducer,
@@ -56,7 +56,10 @@ export function propEach(
/**
* http://turfjs.org/docs/#propreduce
*/
-export function propReduce(
+export function propReduce<
+ Reducer,
+ P extends GeoJsonProperties = GeoJsonProperties,
+>(
geojson: Feature | FeatureCollection | Geometry,
callback: (
previousValue: Reducer,
@@ -70,9 +73,9 @@ export function propReduce(
* http://turfjs.org/docs/#featurereduce
*/
export function featureReduce<
- Reducer extends any,
+ Reducer,
G extends GeometryObject,
- P = GeoJsonProperties
+ P extends GeoJsonProperties = GeoJsonProperties,
>(
geojson:
| Feature
@@ -89,7 +92,10 @@ export function featureReduce<
/**
* http://turfjs.org/docs/#featureeach
*/
-export function featureEach(
+export function featureEach<
+ G extends GeometryObject,
+ P extends GeoJsonProperties = GeoJsonProperties,
+>(
geojson:
| Feature
| FeatureCollection
@@ -106,9 +112,9 @@ export function coordAll(geojson: AllGeoJSON): number[][];
* http://turfjs.org/docs/#geomreduce
*/
export function geomReduce<
- Reducer extends any,
+ Reducer,
G extends GeometryObject,
- P = GeoJsonProperties
+ P extends GeoJsonProperties = GeoJsonProperties,
>(
geojson:
| Feature
@@ -132,7 +138,7 @@ export function geomReduce<
*/
export function geomEach<
G extends GeometryObject | null,
- P = GeoJsonProperties
+ P extends GeoJsonProperties = GeoJsonProperties,
>(
geojson:
| Feature
@@ -153,9 +159,9 @@ export function geomEach<
* http://turfjs.org/docs/#flattenreduce
*/
export function flattenReduce<
- Reducer extends any,
+ Reducer,
G extends GeometryObject,
- P = GeoJsonProperties
+ P extends GeoJsonProperties = GeoJsonProperties,
>(
geojson:
| Feature
@@ -177,7 +183,7 @@ export function flattenReduce<
*/
export function flattenEach<
G extends GeometryObject = GeometryObject,
- P = GeoJsonProperties
+ P extends GeoJsonProperties = GeoJsonProperties,
>(
geojson:
| Feature
@@ -195,7 +201,10 @@ export function flattenEach<
/**
* http://turfjs.org/docs/#segmentreduce
*/
-export function segmentReduce(
+export function segmentReduce<
+ Reducer,
+ P extends GeoJsonProperties = GeoJsonProperties,
+>(
geojson:
| FeatureCollection
| Feature
@@ -216,7 +225,7 @@ export function segmentReduce(
/**
* http://turfjs.org/docs/#segmenteach
*/
-export function segmentEach(
+export function segmentEach
(
geojson: AllGeoJSON,
callback: (
currentSegment?: Feature,
@@ -230,7 +239,10 @@ export function segmentEach(
/**
* http://turfjs.org/docs/#linereduce
*/
-export function lineReduce(
+export function lineReduce<
+ Reducer,
+ P extends GeoJsonProperties = GeoJsonProperties,
+>(
geojson:
| FeatureCollection
| Feature
@@ -250,7 +262,7 @@ export function lineReduce(
/**
* http://turfjs.org/docs/#lineeach
*/
-export function lineEach(
+export function lineEach
(
geojson:
| FeatureCollection
| Feature
@@ -270,7 +282,7 @@ export function lineEach(
*/
export function findSegment<
G extends LineString | MultiLineString | Polygon | MultiPolygon,
- P = GeoJsonProperties
+ P extends GeoJsonProperties = GeoJsonProperties,
>(
geojson: Feature | FeatureCollection | G,
options?: {
@@ -287,7 +299,10 @@ export function findSegment<
/**
* http://turfjs.org/docs/#findpoint
*/
-export function findPoint(
+export function findPoint<
+ G extends GeometryObject,
+ P extends GeoJsonProperties = GeoJsonProperties,
+>(
geojson: Feature | FeatureCollection | G,
options?: {
featureIndex?: number;
diff --git a/packages/turf-meta/package.json b/packages/turf-meta/package.json
index e92ad98a6..f5bd14aaf 100644
--- a/packages/turf-meta/package.json
+++ b/packages/turf-meta/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/meta",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf meta module",
"author": "Turf Authors",
"contributors": [
@@ -60,21 +60,22 @@
"index.d.ts"
],
"scripts": {
- "bench": "node -r esm bench.js",
+ "bench": "tsx bench.js",
"build": "rollup -c ../../rollup.config.js && echo '{\"type\":\"module\"}' > dist/es/package.json",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "node -r esm test.js",
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js",
"test:types": "tsc --esModuleInterop --noEmit --strict types.ts"
},
"devDependencies": {
- "@turf/random": "^7.0.0-alpha.0",
+ "@turf/random": "^7.0.0-alpha.2",
"benchmark": "*",
"npm-run-all": "*",
"rollup": "*",
- "tape": "*"
+ "tape": "*",
+ "tsx": "*"
},
"dependencies": {
- "@turf/helpers": "^7.0.0-alpha.0"
+ "@turf/helpers": "^7.0.0-alpha.2"
}
}
diff --git a/packages/turf-meta/test.js b/packages/turf-meta/test.js
index 611aefca7..32c132889 100644
--- a/packages/turf-meta/test.js
+++ b/packages/turf-meta/test.js
@@ -1209,23 +1209,10 @@ test("meta.coordEach -- indexes -- Multi-Polygon with hole", (t) => {
);
t.deepEqual(featureIndexes, [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
- t.deepEqual(multiFeatureIndexes, [
- 0,
- 0,
- 0,
- 0,
- 0,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- ]);
+ t.deepEqual(
+ multiFeatureIndexes,
+ [0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
+ );
t.deepEqual(geometryIndexes, [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1]);
t.deepEqual(coordIndexes, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]);
// Major Release Change v6.x
diff --git a/packages/turf-midpoint/package.json b/packages/turf-midpoint/package.json
index 59c53670f..c0e905de3 100644
--- a/packages/turf-midpoint/package.json
+++ b/packages/turf-midpoint/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/midpoint",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf midpoint module",
"author": "Turf Authors",
"license": "MIT",
@@ -40,22 +40,23 @@
"index.d.ts"
],
"scripts": {
- "bench": "node -r esm bench.js",
+ "bench": "tsx bench.js",
"build": "rollup -c ../../rollup.config.js && echo '{\"type\":\"module\"}' > dist/es/package.json",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "node -r esm test.js"
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js"
},
"devDependencies": {
"benchmark": "*",
"npm-run-all": "*",
"rollup": "*",
- "tape": "*"
+ "tape": "*",
+ "tsx": "*"
},
"dependencies": {
- "@turf/bearing": "^7.0.0-alpha.0",
- "@turf/destination": "^7.0.0-alpha.0",
- "@turf/distance": "^7.0.0-alpha.0",
- "@turf/helpers": "^7.0.0-alpha.0"
+ "@turf/bearing": "^7.0.0-alpha.2",
+ "@turf/destination": "^7.0.0-alpha.2",
+ "@turf/distance": "^7.0.0-alpha.2",
+ "@turf/helpers": "^7.0.0-alpha.2"
}
}
diff --git a/packages/turf-moran-index/package.json b/packages/turf-moran-index/package.json
index f23a764fd..cb7ebd83f 100644
--- a/packages/turf-moran-index/package.json
+++ b/packages/turf-moran-index/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/moran-index",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf moran-index module",
"author": "Turf Authors",
"contributors": [
@@ -28,7 +28,7 @@
"exports": {
"./package.json": "./package.json",
".": {
- "types": "./index.d.ts",
+ "types": "./dist/js/index.d.ts",
"import": "./dist/es/index.js",
"require": "./dist/js/index.js"
}
@@ -39,13 +39,13 @@
"dist"
],
"scripts": {
- "bench": "ts-node bench.js",
- "build": "npm-run-all build:*",
+ "bench": "tsx bench.js",
+ "build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "ts-node -r esm test.js"
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js"
},
"devDependencies": {
"@types/tape": "*",
@@ -53,15 +53,14 @@
"load-json-file": "*",
"npm-run-all": "*",
"tape": "*",
- "ts-node": "*",
- "tslint": "*",
+ "tsx": "*",
"typescript": "*",
"write-json-file": "*"
},
"dependencies": {
- "@turf/distance-weight": "^7.0.0-alpha.0",
- "@turf/helpers": "^7.0.0-alpha.0",
- "@turf/meta": "^7.0.0-alpha.0",
+ "@turf/distance-weight": "^7.0.0-alpha.2",
+ "@turf/helpers": "^7.0.0-alpha.2",
+ "@turf/meta": "^7.0.0-alpha.2",
"tslib": "^2.3.0"
}
}
diff --git a/packages/turf-nearest-neighbor-analysis/package.json b/packages/turf-nearest-neighbor-analysis/package.json
index f2cf67e59..110ee89fa 100644
--- a/packages/turf-nearest-neighbor-analysis/package.json
+++ b/packages/turf-nearest-neighbor-analysis/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/nearest-neighbor-analysis",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf nearest-neighbor-analysis module",
"author": "Turf Authors",
"contributors": [
@@ -28,7 +28,7 @@
"exports": {
"./package.json": "./package.json",
".": {
- "types": "./index.d.ts",
+ "types": "./dist/js/index.d.ts",
"import": "./dist/es/index.js",
"require": "./dist/js/index.js"
}
@@ -39,35 +39,34 @@
"dist"
],
"scripts": {
- "bench": "ts-node bench.js",
- "build": "npm-run-all build:*",
+ "bench": "tsx bench.js",
+ "build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "ts-node -r esm test.js"
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js"
},
"devDependencies": {
- "@turf/truncate": "^7.0.0-alpha.0",
+ "@turf/truncate": "^7.0.0-alpha.2",
"@types/tape": "*",
"benchmark": "*",
"load-json-file": "*",
"npm-run-all": "*",
"tape": "*",
- "ts-node": "*",
- "tslint": "*",
+ "tsx": "*",
"typescript": "*",
"write-json-file": "*"
},
"dependencies": {
- "@turf/area": "^7.0.0-alpha.0",
- "@turf/bbox": "^7.0.0-alpha.0",
- "@turf/bbox-polygon": "^7.0.0-alpha.0",
- "@turf/centroid": "^7.0.0-alpha.0",
- "@turf/distance": "^7.0.0-alpha.0",
- "@turf/helpers": "^7.0.0-alpha.0",
- "@turf/meta": "^7.0.0-alpha.0",
- "@turf/nearest-point": "^7.0.0-alpha.0",
+ "@turf/area": "^7.0.0-alpha.2",
+ "@turf/bbox": "^7.0.0-alpha.2",
+ "@turf/bbox-polygon": "^7.0.0-alpha.2",
+ "@turf/centroid": "^7.0.0-alpha.2",
+ "@turf/distance": "^7.0.0-alpha.2",
+ "@turf/helpers": "^7.0.0-alpha.2",
+ "@turf/meta": "^7.0.0-alpha.2",
+ "@turf/nearest-point": "^7.0.0-alpha.2",
"tslib": "^2.3.0"
}
}
diff --git a/packages/turf-nearest-point-on-line/package.json b/packages/turf-nearest-point-on-line/package.json
index d33f1c27e..a5958b8d2 100644
--- a/packages/turf-nearest-point-on-line/package.json
+++ b/packages/turf-nearest-point-on-line/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/nearest-point-on-line",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf nearest-point-on-line module",
"author": "Turf Authors",
"license": "MIT",
@@ -21,7 +21,7 @@
"exports": {
"./package.json": "./package.json",
".": {
- "types": "./index.d.ts",
+ "types": "./dist/js/index.d.ts",
"import": "./dist/es/index.js",
"require": "./dist/js/index.js"
}
@@ -32,37 +32,36 @@
"dist"
],
"scripts": {
- "bench": "ts-node bench.js",
- "build": "npm-run-all build:*",
+ "bench": "tsx bench.js",
+ "build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "ts-node -r esm test.js",
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js",
"test:types": "tsc --esModuleInterop --noEmit --strict types.ts"
},
"devDependencies": {
- "@turf/along": "^7.0.0-alpha.0",
- "@turf/length": "^7.0.0-alpha.0",
- "@turf/truncate": "^7.0.0-alpha.0",
+ "@turf/along": "^7.0.0-alpha.2",
+ "@turf/length": "^7.0.0-alpha.2",
+ "@turf/truncate": "^7.0.0-alpha.2",
"@types/tape": "*",
"benchmark": "*",
"load-json-file": "*",
"npm-run-all": "*",
"tape": "*",
- "ts-node": "*",
- "tslint": "*",
+ "tsx": "*",
"typescript": "*",
"write-json-file": "*"
},
"dependencies": {
- "@turf/bearing": "^7.0.0-alpha.0",
- "@turf/destination": "^7.0.0-alpha.0",
- "@turf/distance": "^7.0.0-alpha.0",
- "@turf/helpers": "^7.0.0-alpha.0",
- "@turf/invariant": "^7.0.0-alpha.0",
- "@turf/line-intersect": "^7.0.0-alpha.0",
- "@turf/meta": "^7.0.0-alpha.0",
+ "@turf/bearing": "^7.0.0-alpha.2",
+ "@turf/destination": "^7.0.0-alpha.2",
+ "@turf/distance": "^7.0.0-alpha.2",
+ "@turf/helpers": "^7.0.0-alpha.2",
+ "@turf/invariant": "^7.0.0-alpha.2",
+ "@turf/line-intersect": "^7.0.0-alpha.2",
+ "@turf/meta": "^7.0.0-alpha.2",
"tslib": "^2.3.0"
}
}
diff --git a/packages/turf-nearest-point-to-line/package.json b/packages/turf-nearest-point-to-line/package.json
index d4002be22..642e43052 100644
--- a/packages/turf-nearest-point-to-line/package.json
+++ b/packages/turf-nearest-point-to-line/package.json
@@ -1,6 +1,6 @@
{
"name": "@turf/nearest-point-to-line",
- "version": "7.0.0-alpha.0",
+ "version": "7.0.0-alpha.2",
"description": "turf nearest-point-to-line module",
"author": "Turf Authors",
"contributors": [
@@ -31,7 +31,7 @@
"exports": {
"./package.json": "./package.json",
".": {
- "types": "./index.d.ts",
+ "types": "./dist/js/index.d.ts",
"import": "./dist/es/index.js",
"require": "./dist/js/index.js"
}
@@ -42,34 +42,33 @@
"dist"
],
"scripts": {
- "bench": "ts-node bench.js",
- "build": "npm-run-all build:*",
+ "bench": "tsx bench.js",
+ "build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
- "docs": "node ../../scripts/generate-readmes",
- "test": "npm-run-all test:*",
- "test:tape": "ts-node -r esm test.js",
+ "docs": "tsx ../../scripts/generate-readmes",
+ "test": "npm-run-all --npm-path npm test:*",
+ "test:tape": "tsx test.js",
"test:types": "tsc --esModuleInterop --noEmit --strict types.ts"
},
"devDependencies": {
- "@turf/circle": "^7.0.0-alpha.0",
- "@turf/truncate": "^7.0.0-alpha.0",
+ "@turf/circle": "^7.0.0-alpha.2",
+ "@turf/truncate": "^7.0.0-alpha.2",
"@types/object-assign": "*",
"@types/tape": "*",
"benchmark": "*",
"load-json-file": "*",
"npm-run-all": "*",
"tape": "*",
- "ts-node": "*",
- "tslint": "*",
+ "tsx": "*",
"typescript": "*",
"write-json-file": "*"
},
"dependencies": {
- "@turf/helpers": "^7.0.0-alpha.0",
- "@turf/invariant": "^7.0.0-alpha.0",
- "@turf/meta": "^7.0.0-alpha.0",
- "@turf/point-to-line-distance": "^7.0.0-alpha.0",
+ "@turf/helpers": "^7.0.0-alpha.2",
+ "@turf/invariant": "^7.0.0-alpha.2",
+ "@turf/meta": "^7.0.0-alpha.2",
+ "@turf/point-to-line-distance": "^7.0.0-alpha.2",
"tslib": "^2.3.0"
}
}
diff --git a/packages/turf-nearest-point/README.md b/packages/turf-nearest-point/README.md
index 0e5e14c14..1d9002c0b 100644
--- a/packages/turf-nearest-point/README.md
+++ b/packages/turf-nearest-point/README.md
@@ -13,6 +13,9 @@ is geodesic.
* `targetPoint` **[Coord][2]** the reference point
* `points` **[FeatureCollection][3]<[Point][4]>** against input point set
+* `options` **[Object][5]** Optional parameters (optional, default `{}`)
+
+ * `options.units` **[string][6]** the units of the numeric result (optional, default `'kilometers'`)
### Examples
@@ -31,7 +34,7 @@ var addToMap = [targetPoint, points, nearest];
nearest.properties['marker-color'] = '#F00';
```
-Returns **[Feature][5]<[Point][4]>** the closest point in the set to the reference point
+Returns **[Feature][7]<[Point][4]>** the closest point in the set to the reference point
[1]: https://tools.ietf.org/html/rfc7946#section-3.1.2
@@ -41,7 +44,11 @@ Returns **[Feature][5]<[Point][4]>** the closest point in the set to the referen
[4]: https://tools.ietf.org/html/rfc7946#section-3.1.2
-[5]: https://tools.ietf.org/html/rfc7946#section-3.2
+[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
+
+[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
+
+[7]: https://tools.ietf.org/html/rfc7946#section-3.2