@turf/line-intersect 7.2.0 → 7.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -40,9 +40,9 @@ function lineIntersect(line1, line2, options = {}) {
40
40
  }
41
41
  return _helpers.featureCollection.call(void 0, results.map((r) => _helpers.point.call(void 0, r)));
42
42
  }
43
- var turf_line_intersect_default = lineIntersect;
43
+ var index_default = lineIntersect;
44
44
 
45
45
 
46
46
 
47
- exports.default = turf_line_intersect_default; exports.lineIntersect = lineIntersect;
47
+ exports.default = index_default; exports.lineIntersect = lineIntersect;
48
48
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/turf/turf/packages/turf-line-intersect/dist/cjs/index.cjs","../../index.ts","../../lib/sweepline-intersections-export.ts"],"names":[],"mappings":"AAAA;ACAA,wCAAkD;ADElD;AACA;AECA,iJAAgB;AAET,IAAM,uBAAA,EAAyB,gCAAA;AFAtC;AACA;ACwBA,SAAS,aAAA,CAIP,KAAA,EACA,KAAA,EACA,QAAA,EAGI,CAAC,CAAA,EACqB;AAC1B,EAAA,MAAM,EAAE,iBAAA,EAAmB,IAAA,EAAM,wBAAA,EAA0B,KAAK,EAAA,EAAI,OAAA;AACpE,EAAA,IAAI,SAAA,EAA+B,CAAC,CAAA;AACpC,EAAA,GAAA,CAAI,KAAA,CAAM,KAAA,IAAS,mBAAA;AACjB,IAAA,SAAA,EAAW,QAAA,CAAS,MAAA,CAAO,KAAA,CAAM,QAAQ,CAAA;AAAA,EAAA,KAAA,GAAA,CAClC,KAAA,CAAM,KAAA,IAAS,SAAA,EAAW,QAAA,CAAS,IAAA,CAAK,KAAK,CAAA;AAAA,EAAA,KAAA,GAAA,CAEpD,KAAA,CAAM,KAAA,IAAS,aAAA,GACf,KAAA,CAAM,KAAA,IAAS,UAAA,GACf,KAAA,CAAM,KAAA,IAAS,kBAAA,GACf,KAAA,CAAM,KAAA,IAAS,cAAA,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AA,GAAM,4BAAA,CAAO,CAAC,CAAC,CAAA;AACvD;AAGA,IAAO,4BAAA,EAAQ,aAAA;AD/Cf;AACE;AACA;AACF,qFAAC","file":"/home/runner/work/turf/turf/packages/turf-line-intersect/dist/cjs/index.cjs","sourcesContent":[null,"import { feature, featureCollection, point } from \"@turf/helpers\";\nimport {\n Feature,\n FeatureCollection,\n LineString,\n MultiLineString,\n MultiPolygon,\n Point,\n Polygon,\n} from \"geojson\";\nimport type { Intersection } from \"sweepline-intersections\";\nimport { sweeplineIntersections as findIntersections } from \"./lib/sweepline-intersections-export.js\";\n\n/**\n * Takes any LineString or Polygon GeoJSON and returns the intersecting point(s).\n *\n * @function\n * @param {GeoJSON} line1 any LineString or Polygon\n * @param {GeoJSON} line2 any LineString or Polygon\n * @param {Object} [options={}] Optional parameters\n * @param {boolean} [options.removeDuplicates=true] remove duplicate intersections\n * @param {boolean} [options.ignoreSelfIntersections=true] ignores self-intersections on input features\n * @returns {FeatureCollection<Point>} point(s) that intersect both\n * @example\n * var line1 = turf.lineString([[126, -11], [129, -21]]);\n * var line2 = turf.lineString([[123, -18], [131, -14]]);\n * var intersects = turf.lineIntersect(line1, line2);\n *\n * //addToMap\n * var addToMap = [line1, line2, intersects]\n */\nfunction lineIntersect<\n G1 extends LineString | MultiLineString | Polygon | MultiPolygon,\n G2 extends LineString | MultiLineString | Polygon | MultiPolygon,\n>(\n line1: FeatureCollection<G1> | Feature<G1> | G1,\n line2: FeatureCollection<G2> | Feature<G2> | G2,\n options: {\n removeDuplicates?: boolean;\n ignoreSelfIntersections?: boolean;\n } = {}\n): FeatureCollection<Point> {\n const { removeDuplicates = true, ignoreSelfIntersections = true } = options;\n let features: Feature<G1 | G2>[] = [];\n if (line1.type === \"FeatureCollection\")\n features = features.concat(line1.features);\n else if (line1.type === \"Feature\") features.push(line1);\n else if (\n line1.type === \"LineString\" ||\n line1.type === \"Polygon\" ||\n line1.type === \"MultiLineString\" ||\n line1.type === \"MultiPolygon\"\n ) {\n features.push(feature(line1));\n }\n\n if (line2.type === \"FeatureCollection\")\n features = features.concat(line2.features);\n else if (line2.type === \"Feature\") features.push(line2);\n else if (\n line2.type === \"LineString\" ||\n line2.type === \"Polygon\" ||\n line2.type === \"MultiLineString\" ||\n line2.type === \"MultiPolygon\"\n ) {\n features.push(feature(line2));\n }\n\n const intersections = findIntersections(\n featureCollection(features),\n ignoreSelfIntersections\n );\n\n let results: Intersection[] = [];\n if (removeDuplicates) {\n const unique: Record<string, boolean> = {};\n intersections.forEach((intersection) => {\n const key = intersection.join(\",\");\n if (!unique[key]) {\n unique[key] = true;\n results.push(intersection);\n }\n });\n } else {\n results = intersections;\n }\n return featureCollection(results.map((r) => point(r)));\n}\n\nexport { lineIntersect };\nexport default lineIntersect;\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"]}
1
+ {"version":3,"sources":["/home/runner/work/turf/turf/packages/turf-line-intersect/dist/cjs/index.cjs","../../index.ts","../../lib/sweepline-intersections-export.ts"],"names":[],"mappings":"AAAA;ACAA,wCAAkD;ADElD;AACA;AECA,iJAAgB;AAET,IAAM,uBAAA,EAAyB,gCAAA;AFAtC;AACA;ACwBA,SAAS,aAAA,CAIP,KAAA,EACA,KAAA,EACA,QAAA,EAGI,CAAC,CAAA,EACqB;AAC1B,EAAA,MAAM,EAAE,iBAAA,EAAmB,IAAA,EAAM,wBAAA,EAA0B,KAAK,EAAA,EAAI,OAAA;AACpE,EAAA,IAAI,SAAA,EAA+B,CAAC,CAAA;AACpC,EAAA,GAAA,CAAI,KAAA,CAAM,KAAA,IAAS,mBAAA;AACjB,IAAA,SAAA,EAAW,QAAA,CAAS,MAAA,CAAO,KAAA,CAAM,QAAQ,CAAA;AAAA,EAAA,KAAA,GAAA,CAClC,KAAA,CAAM,KAAA,IAAS,SAAA,EA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AAA,OAAA,CAAQ,IAAA,CAAK,YAAY,CAAA;AAAA,MAC3B;AAAA,IACF,CAAC,CAAA;AAAA,EACH,EAAA,KAAO;AACL,IAAA,QAAA,EAAU,aAAA;AAAA,EACZ;AACA,EAAA,OAAO,wCAAA,OAAkB,CAAQ,GAAA,CAAI,CAAC,CAAA,EAAA,GAAM,4BAAA,CAAO,CAAC,CAAC,CAAA;AACvD;AAGA,IAAO,cAAA,EAAQ,aAAA;AD/Cf;AACE;AACA;AACF,uEAAC","file":"/home/runner/work/turf/turf/packages/turf-line-intersect/dist/cjs/index.cjs","sourcesContent":[null,"import { feature, featureCollection, point } from \"@turf/helpers\";\nimport {\n Feature,\n FeatureCollection,\n LineString,\n MultiLineString,\n MultiPolygon,\n Point,\n Polygon,\n} from \"geojson\";\nimport type { Intersection } from \"sweepline-intersections\";\nimport { sweeplineIntersections as findIntersections } from \"./lib/sweepline-intersections-export.js\";\n\n/**\n * Takes any LineString or Polygon GeoJSON and returns the intersecting point(s).\n *\n * @function\n * @param {GeoJSON} line1 any LineString or Polygon\n * @param {GeoJSON} line2 any LineString or Polygon\n * @param {Object} [options={}] Optional parameters\n * @param {boolean} [options.removeDuplicates=true] remove duplicate intersections\n * @param {boolean} [options.ignoreSelfIntersections=true] ignores self-intersections on input features\n * @returns {FeatureCollection<Point>} point(s) that intersect both\n * @example\n * var line1 = turf.lineString([[126, -11], [129, -21]]);\n * var line2 = turf.lineString([[123, -18], [131, -14]]);\n * var intersects = turf.lineIntersect(line1, line2);\n *\n * //addToMap\n * var addToMap = [line1, line2, intersects]\n */\nfunction lineIntersect<\n G1 extends LineString | MultiLineString | Polygon | MultiPolygon,\n G2 extends LineString | MultiLineString | Polygon | MultiPolygon,\n>(\n line1: FeatureCollection<G1> | Feature<G1> | G1,\n line2: FeatureCollection<G2> | Feature<G2> | G2,\n options: {\n removeDuplicates?: boolean;\n ignoreSelfIntersections?: boolean;\n } = {}\n): FeatureCollection<Point> {\n const { removeDuplicates = true, ignoreSelfIntersections = true } = options;\n let features: Feature<G1 | G2>[] = [];\n if (line1.type === \"FeatureCollection\")\n features = features.concat(line1.features);\n else if (line1.type === \"Feature\") features.push(line1);\n else if (\n line1.type === \"LineString\" ||\n line1.type === \"Polygon\" ||\n line1.type === \"MultiLineString\" ||\n line1.type === \"MultiPolygon\"\n ) {\n features.push(feature(line1));\n }\n\n if (line2.type === \"FeatureCollection\")\n features = features.concat(line2.features);\n else if (line2.type === \"Feature\") features.push(line2);\n else if (\n line2.type === \"LineString\" ||\n line2.type === \"Polygon\" ||\n line2.type === \"MultiLineString\" ||\n line2.type === \"MultiPolygon\"\n ) {\n features.push(feature(line2));\n }\n\n const intersections = findIntersections(\n featureCollection(features),\n ignoreSelfIntersections\n );\n\n let results: Intersection[] = [];\n if (removeDuplicates) {\n const unique: Record<string, boolean> = {};\n intersections.forEach((intersection) => {\n const key = intersection.join(\",\");\n if (!unique[key]) {\n unique[key] = true;\n results.push(intersection);\n }\n });\n } else {\n results = intersections;\n }\n return featureCollection(results.map((r) => point(r)));\n}\n\nexport { lineIntersect };\nexport default lineIntersect;\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
@@ -40,9 +40,9 @@ function lineIntersect(line1, line2, options = {}) {
40
40
  }
41
41
  return featureCollection(results.map((r) => point(r)));
42
42
  }
43
- var turf_line_intersect_default = lineIntersect;
43
+ var index_default = lineIntersect;
44
44
  export {
45
- turf_line_intersect_default as default,
45
+ index_default as default,
46
46
  lineIntersect
47
47
  };
48
48
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../index.ts","../../lib/sweepline-intersections-export.ts"],"sourcesContent":["import { feature, featureCollection, point } from \"@turf/helpers\";\nimport {\n Feature,\n FeatureCollection,\n LineString,\n MultiLineString,\n MultiPolygon,\n Point,\n Polygon,\n} from \"geojson\";\nimport type { Intersection } from \"sweepline-intersections\";\nimport { sweeplineIntersections as findIntersections } from \"./lib/sweepline-intersections-export.js\";\n\n/**\n * Takes any LineString or Polygon GeoJSON and returns the intersecting point(s).\n *\n * @function\n * @param {GeoJSON} line1 any LineString or Polygon\n * @param {GeoJSON} line2 any LineString or Polygon\n * @param {Object} [options={}] Optional parameters\n * @param {boolean} [options.removeDuplicates=true] remove duplicate intersections\n * @param {boolean} [options.ignoreSelfIntersections=true] ignores self-intersections on input features\n * @returns {FeatureCollection<Point>} point(s) that intersect both\n * @example\n * var line1 = turf.lineString([[126, -11], [129, -21]]);\n * var line2 = turf.lineString([[123, -18], [131, -14]]);\n * var intersects = turf.lineIntersect(line1, line2);\n *\n * //addToMap\n * var addToMap = [line1, line2, intersects]\n */\nfunction lineIntersect<\n G1 extends LineString | MultiLineString | Polygon | MultiPolygon,\n G2 extends LineString | MultiLineString | Polygon | MultiPolygon,\n>(\n line1: FeatureCollection<G1> | Feature<G1> | G1,\n line2: FeatureCollection<G2> | Feature<G2> | G2,\n options: {\n removeDuplicates?: boolean;\n ignoreSelfIntersections?: boolean;\n } = {}\n): FeatureCollection<Point> {\n const { removeDuplicates = true, ignoreSelfIntersections = true } = options;\n let features: Feature<G1 | G2>[] = [];\n if (line1.type === \"FeatureCollection\")\n features = features.concat(line1.features);\n else if (line1.type === \"Feature\") features.push(line1);\n else if (\n line1.type === \"LineString\" ||\n line1.type === \"Polygon\" ||\n line1.type === \"MultiLineString\" ||\n line1.type === \"MultiPolygon\"\n ) {\n features.push(feature(line1));\n }\n\n if (line2.type === \"FeatureCollection\")\n features = features.concat(line2.features);\n else if (line2.type === \"Feature\") features.push(line2);\n else if (\n line2.type === \"LineString\" ||\n line2.type === \"Polygon\" ||\n line2.type === \"MultiLineString\" ||\n line2.type === \"MultiPolygon\"\n ) {\n features.push(feature(line2));\n }\n\n const intersections = findIntersections(\n featureCollection(features),\n ignoreSelfIntersections\n );\n\n let results: Intersection[] = [];\n if (removeDuplicates) {\n const unique: Record<string, boolean> = {};\n intersections.forEach((intersection) => {\n const key = intersection.join(\",\");\n if (!unique[key]) {\n unique[key] = true;\n results.push(intersection);\n }\n });\n } else {\n results = intersections;\n }\n return featureCollection(results.map((r) => point(r)));\n}\n\nexport { lineIntersect };\nexport default lineIntersect;\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":";AAAA,SAAS,SAAS,mBAAmB,aAAa;;;ACIlD,OAAO,SAAS;AAET,IAAM,yBAAyB;;;ADyBtC,SAAS,cAIP,OACA,OACA,UAGI,CAAC,GACqB;AAC1B,QAAM,EAAE,mBAAmB,MAAM,0BAA0B,KAAK,IAAI;AACpE,MAAI,WAA+B,CAAC;AACpC,MAAI,MAAM,SAAS;AACjB,eAAW,SAAS,OAAO,MAAM,QAAQ;AAAA,WAClC,MAAM,SAAS,UAAW,UAAS,KAAK,KAAK;AAAA,WAEpD,MAAM,SAAS,gBACf,MAAM,SAAS,aACf,MAAM,SAAS,qBACf,MAAM,SAAS,gBACf;AACA,aAAS,KAAK,QAAQ,KAAK,CAAC;AAAA,EAC9B;AAEA,MAAI,MAAM,SAAS;AACjB,eAAW,SAAS,OAAO,MAAM,QAAQ;AAAA,WAClC,MAAM,SAAS,UAAW,UAAS,KAAK,KAAK;AAAA,WAEpD,MAAM,SAAS,gBACf,MAAM,SAAS,aACf,MAAM,SAAS,qBACf,MAAM,SAAS,gBACf;AACA,aAAS,KAAK,QAAQ,KAAK,CAAC;AAAA,EAC9B;AAEA,QAAM,gBAAgB;AAAA,IACpB,kBAAkB,QAAQ;AAAA,IAC1B;AAAA,EACF;AAEA,MAAI,UAA0B,CAAC;AAC/B,MAAI,kBAAkB;AACpB,UAAM,SAAkC,CAAC;AACzC,kBAAc,QAAQ,CAAC,iBAAiB;AACtC,YAAM,MAAM,aAAa,KAAK,GAAG;AACjC,UAAI,CAAC,OAAO,GAAG,GAAG;AAChB,eAAO,GAAG,IAAI;AACd,gBAAQ,KAAK,YAAY;AAAA,MAC3B;AAAA,IACF,CAAC;AAAA,EACH,OAAO;AACL,cAAU;AAAA,EACZ;AACA,SAAO,kBAAkB,QAAQ,IAAI,CAAC,MAAM,MAAM,CAAC,CAAC,CAAC;AACvD;AAGA,IAAO,8BAAQ;","names":[]}
1
+ {"version":3,"sources":["../../index.ts","../../lib/sweepline-intersections-export.ts"],"sourcesContent":["import { feature, featureCollection, point } from \"@turf/helpers\";\nimport {\n Feature,\n FeatureCollection,\n LineString,\n MultiLineString,\n MultiPolygon,\n Point,\n Polygon,\n} from \"geojson\";\nimport type { Intersection } from \"sweepline-intersections\";\nimport { sweeplineIntersections as findIntersections } from \"./lib/sweepline-intersections-export.js\";\n\n/**\n * Takes any LineString or Polygon GeoJSON and returns the intersecting point(s).\n *\n * @function\n * @param {GeoJSON} line1 any LineString or Polygon\n * @param {GeoJSON} line2 any LineString or Polygon\n * @param {Object} [options={}] Optional parameters\n * @param {boolean} [options.removeDuplicates=true] remove duplicate intersections\n * @param {boolean} [options.ignoreSelfIntersections=true] ignores self-intersections on input features\n * @returns {FeatureCollection<Point>} point(s) that intersect both\n * @example\n * var line1 = turf.lineString([[126, -11], [129, -21]]);\n * var line2 = turf.lineString([[123, -18], [131, -14]]);\n * var intersects = turf.lineIntersect(line1, line2);\n *\n * //addToMap\n * var addToMap = [line1, line2, intersects]\n */\nfunction lineIntersect<\n G1 extends LineString | MultiLineString | Polygon | MultiPolygon,\n G2 extends LineString | MultiLineString | Polygon | MultiPolygon,\n>(\n line1: FeatureCollection<G1> | Feature<G1> | G1,\n line2: FeatureCollection<G2> | Feature<G2> | G2,\n options: {\n removeDuplicates?: boolean;\n ignoreSelfIntersections?: boolean;\n } = {}\n): FeatureCollection<Point> {\n const { removeDuplicates = true, ignoreSelfIntersections = true } = options;\n let features: Feature<G1 | G2>[] = [];\n if (line1.type === \"FeatureCollection\")\n features = features.concat(line1.features);\n else if (line1.type === \"Feature\") features.push(line1);\n else if (\n line1.type === \"LineString\" ||\n line1.type === \"Polygon\" ||\n line1.type === \"MultiLineString\" ||\n line1.type === \"MultiPolygon\"\n ) {\n features.push(feature(line1));\n }\n\n if (line2.type === \"FeatureCollection\")\n features = features.concat(line2.features);\n else if (line2.type === \"Feature\") features.push(line2);\n else if (\n line2.type === \"LineString\" ||\n line2.type === \"Polygon\" ||\n line2.type === \"MultiLineString\" ||\n line2.type === \"MultiPolygon\"\n ) {\n features.push(feature(line2));\n }\n\n const intersections = findIntersections(\n featureCollection(features),\n ignoreSelfIntersections\n );\n\n let results: Intersection[] = [];\n if (removeDuplicates) {\n const unique: Record<string, boolean> = {};\n intersections.forEach((intersection) => {\n const key = intersection.join(\",\");\n if (!unique[key]) {\n unique[key] = true;\n results.push(intersection);\n }\n });\n } else {\n results = intersections;\n }\n return featureCollection(results.map((r) => point(r)));\n}\n\nexport { lineIntersect };\nexport default lineIntersect;\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":";AAAA,SAAS,SAAS,mBAAmB,aAAa;;;ACIlD,OAAO,SAAS;AAET,IAAM,yBAAyB;;;ADyBtC,SAAS,cAIP,OACA,OACA,UAGI,CAAC,GACqB;AAC1B,QAAM,EAAE,mBAAmB,MAAM,0BAA0B,KAAK,IAAI;AACpE,MAAI,WAA+B,CAAC;AACpC,MAAI,MAAM,SAAS;AACjB,eAAW,SAAS,OAAO,MAAM,QAAQ;AAAA,WAClC,MAAM,SAAS,UAAW,UAAS,KAAK,KAAK;AAAA,WAEpD,MAAM,SAAS,gBACf,MAAM,SAAS,aACf,MAAM,SAAS,qBACf,MAAM,SAAS,gBACf;AACA,aAAS,KAAK,QAAQ,KAAK,CAAC;AAAA,EAC9B;AAEA,MAAI,MAAM,SAAS;AACjB,eAAW,SAAS,OAAO,MAAM,QAAQ;AAAA,WAClC,MAAM,SAAS,UAAW,UAAS,KAAK,KAAK;AAAA,WAEpD,MAAM,SAAS,gBACf,MAAM,SAAS,aACf,MAAM,SAAS,qBACf,MAAM,SAAS,gBACf;AACA,aAAS,KAAK,QAAQ,KAAK,CAAC;AAAA,EAC9B;AAEA,QAAM,gBAAgB;AAAA,IACpB,kBAAkB,QAAQ;AAAA,IAC1B;AAAA,EACF;AAEA,MAAI,UAA0B,CAAC;AAC/B,MAAI,kBAAkB;AACpB,UAAM,SAAkC,CAAC;AACzC,kBAAc,QAAQ,CAAC,iBAAiB;AACtC,YAAM,MAAM,aAAa,KAAK,GAAG;AACjC,UAAI,CAAC,OAAO,GAAG,GAAG;AAChB,eAAO,GAAG,IAAI;AACd,gBAAQ,KAAK,YAAY;AAAA,MAC3B;AAAA,IACF,CAAC;AAAA,EACH,OAAO;AACL,cAAU;AAAA,EACZ;AACA,SAAO,kBAAkB,QAAQ,IAAI,CAAC,MAAM,MAAM,CAAC,CAAC,CAAC;AACvD;AAGA,IAAO,gBAAQ;","names":[]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@turf/line-intersect",
3
- "version": "7.2.0",
4
- "description": "turf line-intersect module",
3
+ "version": "7.3.0",
4
+ "description": "Takes any LineString or Polygon GeoJSON and returns the intersecting point(s).",
5
5
  "author": "Turf Authors",
6
6
  "contributors": [
7
7
  "Denis Carriere <@DenisCarriere>",
@@ -56,23 +56,23 @@
56
56
  "test:tape": "tsx test.ts"
57
57
  },
58
58
  "devDependencies": {
59
- "@turf/truncate": "^7.2.0",
59
+ "@turf/truncate": "7.3.0",
60
60
  "@types/benchmark": "^2.1.5",
61
- "@types/tape": "^4.13.4",
61
+ "@types/tape": "^5.8.1",
62
62
  "benchmark": "^2.1.4",
63
63
  "load-json-file": "^7.0.1",
64
64
  "npm-run-all": "^4.1.5",
65
65
  "tape": "^5.9.0",
66
- "tsup": "^8.3.5",
67
- "tsx": "^4.19.2",
68
- "typescript": "^5.5.4",
69
- "write-json-file": "^5.0.0"
66
+ "tsup": "^8.4.0",
67
+ "tsx": "^4.19.4",
68
+ "typescript": "^5.8.3",
69
+ "write-json-file": "^6.0.0"
70
70
  },
71
71
  "dependencies": {
72
- "@turf/helpers": "^7.2.0",
72
+ "@turf/helpers": "7.3.0",
73
73
  "@types/geojson": "^7946.0.10",
74
74
  "sweepline-intersections": "^1.5.0",
75
75
  "tslib": "^2.8.1"
76
76
  },
77
- "gitHead": "7b0f0374c4668cd569f8904c71e2ae7d941be867"
77
+ "gitHead": "9f58a103e8f9a587ab640307ed03ba5233913ddd"
78
78
  }