@turf/flatten 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.
@@ -9,9 +9,9 @@ function flatten(geojson) {
9
9
  });
10
10
  return _helpers.featureCollection.call(void 0, results);
11
11
  }
12
- var turf_flatten_default = flatten;
12
+ var index_default = flatten;
13
13
 
14
14
 
15
15
 
16
- exports.default = turf_flatten_default; exports.flatten = flatten;
16
+ exports.default = index_default; exports.flatten = flatten;
17
17
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/turf/turf/packages/turf-flatten/dist/cjs/index.cjs","../../index.ts"],"names":[],"mappings":"AAAA;ACAA,kCAA4B;AAC5B,wCAAkC;AA6ClC,SAAS,OAAA,CAAQ,OAAA,EAAwC;AACvD,EAAA,GAAA,CAAI,CAAC,OAAA,EAAS,MAAM,IAAI,KAAA,CAAM,qBAAqB,CAAA;AAEnD,EAAA,IAAI,QAAA,EAAqB,CAAC,CAAA;AAC1B,EAAA,+BAAA,OAAY,EAAS,QAAA,CAAU,OAAA,EAAS;AACtC,IAAA,OAAA,CAAQ,IAAA,CAAK,OAAO,CAAA;AAAA,EACtB,CAAC,CAAA;AACD,EAAA,OAAO,wCAAA,OAAyB,CAAA;AAClC;AAGA,IAAO,qBAAA,EAAQ,OAAA;AD7Cf;AACE;AACA;AACF,kEAAC","file":"/home/runner/work/turf/turf/packages/turf-flatten/dist/cjs/index.cjs","sourcesContent":[null,"import { flattenEach } from \"@turf/meta\";\nimport { featureCollection } from \"@turf/helpers\";\nimport type { AllGeoJSON } from \"@turf/helpers\";\nimport type {\n Feature,\n Point,\n MultiPoint,\n LineString,\n MultiLineString,\n FeatureCollection,\n Polygon,\n MultiPolygon,\n} from \"geojson\";\n\n/**\n * Flattens any {@link GeoJSON} to a {@link FeatureCollection} inspired by [geojson-flatten](https://github.com/tmcw/geojson-flatten).\n *\n * @function\n * @param {GeoJSON} geojson any valid GeoJSON Object\n * @returns {FeatureCollection<any>} all Multi-Geometries are flattened into single Features\n * @example\n * var multiGeometry = turf.multiPolygon([\n * [[[102.0, 2.0], [103.0, 2.0], [103.0, 3.0], [102.0, 3.0], [102.0, 2.0]]],\n * [[[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]],\n * [[100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2]]]\n * ]);\n *\n * var flatten = turf.flatten(multiGeometry);\n *\n * //addToMap\n * var addToMap = [flatten]\n */\nfunction flatten<T extends Point | MultiPoint>(\n geojson: Feature<T> | FeatureCollection<T> | T\n): FeatureCollection<Point>;\n\nfunction flatten<T extends LineString | MultiLineString>(\n geojson: Feature<T> | FeatureCollection<T> | T\n): FeatureCollection<LineString>;\n\nfunction flatten<T extends Polygon | MultiPolygon>(\n geojson: Feature<T> | FeatureCollection<T> | T\n): FeatureCollection<Polygon>;\n\nfunction flatten(geojson: AllGeoJSON): FeatureCollection<any>;\n\nfunction flatten(geojson: AllGeoJSON): FeatureCollection {\n if (!geojson) throw new Error(\"geojson is required\");\n\n var results: Feature[] = [];\n flattenEach(geojson, function (feature) {\n results.push(feature);\n });\n return featureCollection(results);\n}\n\nexport { flatten };\nexport default flatten;\n"]}
1
+ {"version":3,"sources":["/home/runner/work/turf/turf/packages/turf-flatten/dist/cjs/index.cjs","../../index.ts"],"names":[],"mappings":"AAAA;ACAA,kCAA4B;AAC5B,wCAAkC;AA6ClC,SAAS,OAAA,CAAQ,OAAA,EAAwC;AACvD,EAAA,GAAA,CAAI,CAAC,OAAA,EAAS,MAAM,IAAI,KAAA,CAAM,qBAAqB,CAAA;AAEnD,EAAA,IAAI,QAAA,EAAqB,CAAC,CAAA;AAC1B,EAAA,+BAAA,OAAY,EAAS,QAAA,CAAU,OAAA,EAAS;AACtC,IAAA,OAAA,CAAQ,IAAA,CAAK,OAAO,CAAA;AAAA,EACtB,CAAC,CAAA;AACD,EAAA,OAAO,wCAAA,OAAyB,CAAA;AAClC;AAGA,IAAO,cAAA,EAAQ,OAAA;AD7Cf;AACE;AACA;AACF,2DAAC","file":"/home/runner/work/turf/turf/packages/turf-flatten/dist/cjs/index.cjs","sourcesContent":[null,"import { flattenEach } from \"@turf/meta\";\nimport { featureCollection } from \"@turf/helpers\";\nimport type { AllGeoJSON } from \"@turf/helpers\";\nimport type {\n Feature,\n Point,\n MultiPoint,\n LineString,\n MultiLineString,\n FeatureCollection,\n Polygon,\n MultiPolygon,\n} from \"geojson\";\n\n/**\n * Flattens any {@link GeoJSON} to a {@link FeatureCollection} inspired by [geojson-flatten](https://github.com/tmcw/geojson-flatten).\n *\n * @function\n * @param {GeoJSON} geojson any valid GeoJSON Object\n * @returns {FeatureCollection<any>} all Multi-Geometries are flattened into single Features\n * @example\n * var multiGeometry = turf.multiPolygon([\n * [[[102.0, 2.0], [103.0, 2.0], [103.0, 3.0], [102.0, 3.0], [102.0, 2.0]]],\n * [[[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]],\n * [[100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2]]]\n * ]);\n *\n * var flatten = turf.flatten(multiGeometry);\n *\n * //addToMap\n * var addToMap = [flatten]\n */\nfunction flatten<T extends Point | MultiPoint>(\n geojson: Feature<T> | FeatureCollection<T> | T\n): FeatureCollection<Point>;\n\nfunction flatten<T extends LineString | MultiLineString>(\n geojson: Feature<T> | FeatureCollection<T> | T\n): FeatureCollection<LineString>;\n\nfunction flatten<T extends Polygon | MultiPolygon>(\n geojson: Feature<T> | FeatureCollection<T> | T\n): FeatureCollection<Polygon>;\n\nfunction flatten(geojson: AllGeoJSON): FeatureCollection<any>;\n\nfunction flatten(geojson: AllGeoJSON): FeatureCollection {\n if (!geojson) throw new Error(\"geojson is required\");\n\n var results: Feature[] = [];\n flattenEach(geojson, function (feature) {\n results.push(feature);\n });\n return featureCollection(results);\n}\n\nexport { flatten };\nexport default flatten;\n"]}
package/dist/esm/index.js CHANGED
@@ -9,9 +9,9 @@ function flatten(geojson) {
9
9
  });
10
10
  return featureCollection(results);
11
11
  }
12
- var turf_flatten_default = flatten;
12
+ var index_default = flatten;
13
13
  export {
14
- turf_flatten_default as default,
14
+ index_default as default,
15
15
  flatten
16
16
  };
17
17
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../index.ts"],"sourcesContent":["import { flattenEach } from \"@turf/meta\";\nimport { featureCollection } from \"@turf/helpers\";\nimport type { AllGeoJSON } from \"@turf/helpers\";\nimport type {\n Feature,\n Point,\n MultiPoint,\n LineString,\n MultiLineString,\n FeatureCollection,\n Polygon,\n MultiPolygon,\n} from \"geojson\";\n\n/**\n * Flattens any {@link GeoJSON} to a {@link FeatureCollection} inspired by [geojson-flatten](https://github.com/tmcw/geojson-flatten).\n *\n * @function\n * @param {GeoJSON} geojson any valid GeoJSON Object\n * @returns {FeatureCollection<any>} all Multi-Geometries are flattened into single Features\n * @example\n * var multiGeometry = turf.multiPolygon([\n * [[[102.0, 2.0], [103.0, 2.0], [103.0, 3.0], [102.0, 3.0], [102.0, 2.0]]],\n * [[[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]],\n * [[100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2]]]\n * ]);\n *\n * var flatten = turf.flatten(multiGeometry);\n *\n * //addToMap\n * var addToMap = [flatten]\n */\nfunction flatten<T extends Point | MultiPoint>(\n geojson: Feature<T> | FeatureCollection<T> | T\n): FeatureCollection<Point>;\n\nfunction flatten<T extends LineString | MultiLineString>(\n geojson: Feature<T> | FeatureCollection<T> | T\n): FeatureCollection<LineString>;\n\nfunction flatten<T extends Polygon | MultiPolygon>(\n geojson: Feature<T> | FeatureCollection<T> | T\n): FeatureCollection<Polygon>;\n\nfunction flatten(geojson: AllGeoJSON): FeatureCollection<any>;\n\nfunction flatten(geojson: AllGeoJSON): FeatureCollection {\n if (!geojson) throw new Error(\"geojson is required\");\n\n var results: Feature[] = [];\n flattenEach(geojson, function (feature) {\n results.push(feature);\n });\n return featureCollection(results);\n}\n\nexport { flatten };\nexport default flatten;\n"],"mappings":";AAAA,SAAS,mBAAmB;AAC5B,SAAS,yBAAyB;AA6ClC,SAAS,QAAQ,SAAwC;AACvD,MAAI,CAAC,QAAS,OAAM,IAAI,MAAM,qBAAqB;AAEnD,MAAI,UAAqB,CAAC;AAC1B,cAAY,SAAS,SAAU,SAAS;AACtC,YAAQ,KAAK,OAAO;AAAA,EACtB,CAAC;AACD,SAAO,kBAAkB,OAAO;AAClC;AAGA,IAAO,uBAAQ;","names":[]}
1
+ {"version":3,"sources":["../../index.ts"],"sourcesContent":["import { flattenEach } from \"@turf/meta\";\nimport { featureCollection } from \"@turf/helpers\";\nimport type { AllGeoJSON } from \"@turf/helpers\";\nimport type {\n Feature,\n Point,\n MultiPoint,\n LineString,\n MultiLineString,\n FeatureCollection,\n Polygon,\n MultiPolygon,\n} from \"geojson\";\n\n/**\n * Flattens any {@link GeoJSON} to a {@link FeatureCollection} inspired by [geojson-flatten](https://github.com/tmcw/geojson-flatten).\n *\n * @function\n * @param {GeoJSON} geojson any valid GeoJSON Object\n * @returns {FeatureCollection<any>} all Multi-Geometries are flattened into single Features\n * @example\n * var multiGeometry = turf.multiPolygon([\n * [[[102.0, 2.0], [103.0, 2.0], [103.0, 3.0], [102.0, 3.0], [102.0, 2.0]]],\n * [[[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]],\n * [[100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2]]]\n * ]);\n *\n * var flatten = turf.flatten(multiGeometry);\n *\n * //addToMap\n * var addToMap = [flatten]\n */\nfunction flatten<T extends Point | MultiPoint>(\n geojson: Feature<T> | FeatureCollection<T> | T\n): FeatureCollection<Point>;\n\nfunction flatten<T extends LineString | MultiLineString>(\n geojson: Feature<T> | FeatureCollection<T> | T\n): FeatureCollection<LineString>;\n\nfunction flatten<T extends Polygon | MultiPolygon>(\n geojson: Feature<T> | FeatureCollection<T> | T\n): FeatureCollection<Polygon>;\n\nfunction flatten(geojson: AllGeoJSON): FeatureCollection<any>;\n\nfunction flatten(geojson: AllGeoJSON): FeatureCollection {\n if (!geojson) throw new Error(\"geojson is required\");\n\n var results: Feature[] = [];\n flattenEach(geojson, function (feature) {\n results.push(feature);\n });\n return featureCollection(results);\n}\n\nexport { flatten };\nexport default flatten;\n"],"mappings":";AAAA,SAAS,mBAAmB;AAC5B,SAAS,yBAAyB;AA6ClC,SAAS,QAAQ,SAAwC;AACvD,MAAI,CAAC,QAAS,OAAM,IAAI,MAAM,qBAAqB;AAEnD,MAAI,UAAqB,CAAC;AAC1B,cAAY,SAAS,SAAU,SAAS;AACtC,YAAQ,KAAK,OAAO;AAAA,EACtB,CAAC;AACD,SAAO,kBAAkB,OAAO;AAClC;AAGA,IAAO,gBAAQ;","names":[]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@turf/flatten",
3
- "version": "7.2.0",
4
- "description": "turf flatten module",
3
+ "version": "7.3.0",
4
+ "description": "Flattens any GeoJSON to a FeatureCollection",
5
5
  "author": "Turf Authors",
6
6
  "contributors": [
7
7
  "Tom MacWright <@tmcw>",
@@ -58,21 +58,21 @@
58
58
  },
59
59
  "devDependencies": {
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",
73
- "@turf/meta": "^7.2.0",
72
+ "@turf/helpers": "7.3.0",
73
+ "@turf/meta": "7.3.0",
74
74
  "@types/geojson": "^7946.0.10",
75
75
  "tslib": "^2.8.1"
76
76
  },
77
- "gitHead": "7b0f0374c4668cd569f8904c71e2ae7d941be867"
77
+ "gitHead": "9f58a103e8f9a587ab640307ed03ba5233913ddd"
78
78
  }