@turf/kinks 7.0.0 → 7.1.0-alpha.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs +1 -5
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/index.js +0 -4
- package/dist/esm/index.js.map +1 -1
- package/package.json +4 -4
package/dist/cjs/index.cjs
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
2
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
-
|
|
4
|
-
// index.ts
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }// index.ts
|
|
5
2
|
var _helpers = require('@turf/helpers');
|
|
6
3
|
|
|
7
4
|
// lib/sweepline-intersections-export.ts
|
|
@@ -26,7 +23,6 @@ function kinks(featureIn) {
|
|
|
26
23
|
}
|
|
27
24
|
return results;
|
|
28
25
|
}
|
|
29
|
-
__name(kinks, "kinks");
|
|
30
26
|
var turf_kinks_default = kinks;
|
|
31
27
|
|
|
32
28
|
|
package/dist/cjs/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../index.ts","../../lib/sweepline-intersections-export.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../index.ts","../../lib/sweepline-intersections-export.ts"],"names":[],"mappings":";AASA,SAAS,aAAa;;;ACLtB,OAAO,SAAS;AAET,IAAM,yBAAyB;;;AD4BtC,SAAS,MACP,WAC0B;AAC1B,QAAM,UAAoC;AAAA,IACxC,MAAM;AAAA,IACN,UAAU,CAAC;AAAA,EACb;AACA,MACE,UAAU,SAAS,cACjB,UAAsB,SAAS,SAAS,WACvC,UAAsB,SAAS,SAAS,eAC3C;AACA,UAAM,IAAI;AAAA,MACR;AAAA,IAEF;AAAA,EACF;AACA,QAAM,gBAAgB,uBAAkB,WAAW,KAAK;AACxD,WAAS,IAAI,GAAG,IAAI,cAAc,QAAQ,EAAE,GAAG;AAC7C,UAAM,eAAe,cAAc,CAAC;AACpC,YAAQ,SAAS,KAAK,MAAM,CAAC,aAAa,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;AAAA,EACjE;AACA,SAAO;AACT;AAGA,IAAO,qBAAQ","sourcesContent":["import {\n Feature,\n FeatureCollection,\n LineString,\n MultiLineString,\n MultiPolygon,\n Point,\n Polygon,\n} from \"geojson\";\nimport { point } from \"@turf/helpers\";\nimport { sweeplineIntersections as findIntersections } from \"./lib/sweepline-intersections-export.js\";\n\n/**\n * Takes a {@link LineString|linestring}, {@link MultiLineString|multi-linestring},\n * {@link MultiPolygon|multi-polygon} or {@link Polygon|polygon} and\n * returns {@link Point|points} at all self-intersections.\n *\n * @name kinks\n * @param {Feature<LineString|MultiLineString|MultiPolygon|Polygon>} featureIn input feature\n * @returns {FeatureCollection<Point>} self-intersections\n * @example\n * var poly = turf.polygon([[\n * [-12.034835, 8.901183],\n * [-12.060413, 8.899826],\n * [-12.03638, 8.873199],\n * [-12.059383, 8.871418],\n * [-12.034835, 8.901183]\n * ]]);\n *\n * var kinks = turf.kinks(poly);\n *\n * //addToMap\n * var addToMap = [poly, kinks]\n */\nfunction kinks<T extends LineString | MultiLineString | Polygon | MultiPolygon>(\n featureIn: Feature<T>\n): FeatureCollection<Point> {\n const results: FeatureCollection<Point> = {\n type: \"FeatureCollection\",\n features: [],\n };\n if (\n featureIn.type === \"Feature\" &&\n ((featureIn as Feature).geometry.type === \"Point\" ||\n (featureIn as Feature).geometry.type === \"MultiPoint\")\n ) {\n throw new Error(\n \"Input must be a LineString, MultiLineString, \" +\n \"Polygon, or MultiPolygon Feature or Geometry\"\n );\n }\n const intersections = findIntersections(featureIn, false);\n for (let i = 0; i < intersections.length; ++i) {\n const intersection = intersections[i];\n results.features.push(point([intersection[0], intersection[1]]));\n }\n return results;\n}\n\nexport { kinks };\nexport default kinks;\n","// Get around problems with moduleResolution node16 and some older libraries.\n// Manifests as \"This expression is not callable ... has no call signatures\"\n// https://stackoverflow.com/a/74709714\n\nimport lib from \"sweepline-intersections\";\n\nexport const sweeplineIntersections = lib as unknown as typeof lib.default;\n"]}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
-
|
|
4
1
|
// index.ts
|
|
5
2
|
import { point } from "@turf/helpers";
|
|
6
3
|
|
|
@@ -26,7 +23,6 @@ function kinks(featureIn) {
|
|
|
26
23
|
}
|
|
27
24
|
return results;
|
|
28
25
|
}
|
|
29
|
-
__name(kinks, "kinks");
|
|
30
26
|
var turf_kinks_default = kinks;
|
|
31
27
|
export {
|
|
32
28
|
turf_kinks_default as default,
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../index.ts","../../lib/sweepline-intersections-export.ts"],"sourcesContent":["import {\n Feature,\n FeatureCollection,\n LineString,\n MultiLineString,\n MultiPolygon,\n Point,\n Polygon,\n} from \"geojson\";\nimport { point } from \"@turf/helpers\";\nimport { sweeplineIntersections as findIntersections } from \"./lib/sweepline-intersections-export.js\";\n\n/**\n * Takes a {@link LineString|linestring}, {@link MultiLineString|multi-linestring},\n * {@link MultiPolygon|multi-polygon} or {@link Polygon|polygon} and\n * returns {@link Point|points} at all self-intersections.\n *\n * @name kinks\n * @param {Feature<LineString|MultiLineString|MultiPolygon|Polygon>} featureIn input feature\n * @returns {FeatureCollection<Point>} self-intersections\n * @example\n * var poly = turf.polygon([[\n * [-12.034835, 8.901183],\n * [-12.060413, 8.899826],\n * [-12.03638, 8.873199],\n * [-12.059383, 8.871418],\n * [-12.034835, 8.901183]\n * ]]);\n *\n * var kinks = turf.kinks(poly);\n *\n * //addToMap\n * var addToMap = [poly, kinks]\n */\nfunction kinks<T extends LineString | MultiLineString | Polygon | MultiPolygon>(\n featureIn: Feature<T>\n): FeatureCollection<Point> {\n const results: FeatureCollection<Point> = {\n type: \"FeatureCollection\",\n features: [],\n };\n if (\n featureIn.type === \"Feature\" &&\n ((featureIn as Feature).geometry.type === \"Point\" ||\n (featureIn as Feature).geometry.type === \"MultiPoint\")\n ) {\n throw new Error(\n \"Input must be a LineString, MultiLineString, \" +\n \"Polygon, or MultiPolygon Feature or Geometry\"\n );\n }\n const intersections = findIntersections(featureIn, false);\n for (let i = 0; i < intersections.length; ++i) {\n const intersection = intersections[i];\n results.features.push(point([intersection[0], intersection[1]]));\n }\n return results;\n}\n\nexport { kinks };\nexport default kinks;\n","// Get around problems with moduleResolution node16 and some older libraries.\n// Manifests as \"This expression is not callable ... has no call signatures\"\n// https://stackoverflow.com/a/74709714\n\nimport lib from \"sweepline-intersections\";\n\nexport const sweeplineIntersections = lib as unknown as typeof lib.default;\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../index.ts","../../lib/sweepline-intersections-export.ts"],"sourcesContent":["import {\n Feature,\n FeatureCollection,\n LineString,\n MultiLineString,\n MultiPolygon,\n Point,\n Polygon,\n} from \"geojson\";\nimport { point } from \"@turf/helpers\";\nimport { sweeplineIntersections as findIntersections } from \"./lib/sweepline-intersections-export.js\";\n\n/**\n * Takes a {@link LineString|linestring}, {@link MultiLineString|multi-linestring},\n * {@link MultiPolygon|multi-polygon} or {@link Polygon|polygon} and\n * returns {@link Point|points} at all self-intersections.\n *\n * @name kinks\n * @param {Feature<LineString|MultiLineString|MultiPolygon|Polygon>} featureIn input feature\n * @returns {FeatureCollection<Point>} self-intersections\n * @example\n * var poly = turf.polygon([[\n * [-12.034835, 8.901183],\n * [-12.060413, 8.899826],\n * [-12.03638, 8.873199],\n * [-12.059383, 8.871418],\n * [-12.034835, 8.901183]\n * ]]);\n *\n * var kinks = turf.kinks(poly);\n *\n * //addToMap\n * var addToMap = [poly, kinks]\n */\nfunction kinks<T extends LineString | MultiLineString | Polygon | MultiPolygon>(\n featureIn: Feature<T>\n): FeatureCollection<Point> {\n const results: FeatureCollection<Point> = {\n type: \"FeatureCollection\",\n features: [],\n };\n if (\n featureIn.type === \"Feature\" &&\n ((featureIn as Feature).geometry.type === \"Point\" ||\n (featureIn as Feature).geometry.type === \"MultiPoint\")\n ) {\n throw new Error(\n \"Input must be a LineString, MultiLineString, \" +\n \"Polygon, or MultiPolygon Feature or Geometry\"\n );\n }\n const intersections = findIntersections(featureIn, false);\n for (let i = 0; i < intersections.length; ++i) {\n const intersection = intersections[i];\n results.features.push(point([intersection[0], intersection[1]]));\n }\n return results;\n}\n\nexport { kinks };\nexport default kinks;\n","// Get around problems with moduleResolution node16 and some older libraries.\n// Manifests as \"This expression is not callable ... has no call signatures\"\n// https://stackoverflow.com/a/74709714\n\nimport lib from \"sweepline-intersections\";\n\nexport const sweeplineIntersections = lib as unknown as typeof lib.default;\n"],"mappings":";AASA,SAAS,aAAa;;;ACLtB,OAAO,SAAS;AAET,IAAM,yBAAyB;;;AD4BtC,SAAS,MACP,WAC0B;AAC1B,QAAM,UAAoC;AAAA,IACxC,MAAM;AAAA,IACN,UAAU,CAAC;AAAA,EACb;AACA,MACE,UAAU,SAAS,cACjB,UAAsB,SAAS,SAAS,WACvC,UAAsB,SAAS,SAAS,eAC3C;AACA,UAAM,IAAI;AAAA,MACR;AAAA,IAEF;AAAA,EACF;AACA,QAAM,gBAAgB,uBAAkB,WAAW,KAAK;AACxD,WAAS,IAAI,GAAG,IAAI,cAAc,QAAQ,EAAE,GAAG;AAC7C,UAAM,eAAe,cAAc,CAAC;AACpC,YAAQ,SAAS,KAAK,MAAM,CAAC,aAAa,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;AAAA,EACjE;AACA,SAAO;AACT;AAGA,IAAO,qBAAQ;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@turf/kinks",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.1.0-alpha.7+0ce6ecca0",
|
|
4
4
|
"description": "turf kinks module",
|
|
5
5
|
"author": "Turf Authors",
|
|
6
6
|
"license": "MIT",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"test:types": "tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@turf/meta": "^7.0.
|
|
54
|
+
"@turf/meta": "^7.1.0-alpha.7+0ce6ecca0",
|
|
55
55
|
"@types/benchmark": "^2.1.5",
|
|
56
56
|
"@types/tape": "^4.2.32",
|
|
57
57
|
"benchmark": "^2.1.4",
|
|
@@ -64,9 +64,9 @@
|
|
|
64
64
|
"write-json-file": "^5.0.0"
|
|
65
65
|
},
|
|
66
66
|
"dependencies": {
|
|
67
|
-
"@turf/helpers": "^7.0.
|
|
67
|
+
"@turf/helpers": "^7.1.0-alpha.7+0ce6ecca0",
|
|
68
68
|
"sweepline-intersections": "^1.5.0",
|
|
69
69
|
"tslib": "^2.6.2"
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "0ce6ecca05829690270fec6d6bed2003495fe0ea"
|
|
72
72
|
}
|