@turf/flip 7.2.0 → 7.3.1

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.
@@ -17,9 +17,9 @@ function flip(geojson, options) {
17
17
  });
18
18
  return geojson;
19
19
  }
20
- var turf_flip_default = flip;
20
+ var index_default = flip;
21
21
 
22
22
 
23
23
 
24
- exports.default = turf_flip_default; exports.flip = flip;
24
+ exports.default = index_default; exports.flip = flip;
25
25
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/turf/turf/packages/turf-flip/dist/cjs/index.cjs","../../index.ts"],"names":[],"mappings":"AAAA;ACAA,kCAA0B;AAC1B,wCAAqC;AACrC,oCAAsB;AAkBtB,SAAS,IAAA,CACP,OAAA,EACA,OAAA,EAGG;AAzBL,EAAA,IAAA,EAAA;AA2BE,EAAA,QAAA,EAAU,QAAA,GAAW,CAAC,CAAA;AACtB,EAAA,GAAA,CAAI,CAAC,+BAAA,OAAgB,CAAA,EAAG,MAAM,IAAI,KAAA,CAAM,oBAAoB,CAAA;AAC5D,EAAA,MAAM,OAAA,EAAA,CAAS,GAAA,EAAA,OAAA,CAAQ,MAAA,EAAA,GAAR,KAAA,EAAA,GAAA,EAAkB,KAAA;AAEjC,EAAA,GAAA,CAAI,CAAC,OAAA,EAAS,MAAM,IAAI,KAAA,CAAM,qBAAqB,CAAA;AAInD,EAAA,GAAA,CAAI,OAAA,IAAW,MAAA,GAAS,OAAA,IAAW,KAAA,CAAA,EAAW,QAAA,EAAU,0BAAA,OAAa,CAAA;AAErE,EAAA,6BAAA,OAAU,EAAS,QAAA,CAAU,KAAA,EAAO;AAClC,IAAA,IAAI,EAAA,EAAI,KAAA,CAAM,CAAC,CAAA;AACf,IAAA,IAAI,EAAA,EAAI,KAAA,CAAM,CAAC,CAAA;AACf,IAAA,KAAA,CAAM,CAAC,EAAA,EAAI,CAAA;AACX,IAAA,KAAA,CAAM,CAAC,EAAA,EAAI,CAAA;AAAA,EACb,CAAC,CAAA;AACD,EAAA,OAAO,OAAA;AACT;AAGA,IAAO,kBAAA,EAAQ,IAAA;AD3Bf;AACE;AACA;AACF,yDAAC","file":"/home/runner/work/turf/turf/packages/turf-flip/dist/cjs/index.cjs","sourcesContent":[null,"import { coordEach } from \"@turf/meta\";\nimport { isObject, AllGeoJSON } from \"@turf/helpers\";\nimport { clone } from \"@turf/clone\";\n\n/**\n * Takes input features and flips all of their coordinates from `[x, y]` to `[y, x]`.\n *\n * @function\n * @param {GeoJSON} geojson input features\n * @param {Object} [options={}] Optional parameters\n * @param {boolean} [options.mutate=false] allows GeoJSON input to be mutated (significant performance increase if true)\n * @returns {GeoJSON} a feature or set of features of the same type as `input` with flipped coordinates\n * @example\n * var serbia = turf.point([20.566406, 43.421008]);\n *\n * var saudiArabia = turf.flip(serbia);\n *\n * //addToMap\n * var addToMap = [serbia, saudiArabia];\n */\nfunction flip<T extends AllGeoJSON>(\n geojson: T,\n options?: {\n mutate?: boolean;\n }\n): T {\n // Optional parameters\n options = options || {};\n if (!isObject(options)) throw new Error(\"options is invalid\");\n const mutate = options.mutate ?? false;\n\n if (!geojson) throw new Error(\"geojson is required\");\n // ensure that we don't modify features in-place and changes to the\n // output do not change the previous feature, including changes to nested\n // properties.\n if (mutate === false || mutate === undefined) geojson = clone(geojson);\n\n coordEach(geojson, function (coord) {\n var x = coord[0];\n var y = coord[1];\n coord[0] = y;\n coord[1] = x;\n });\n return geojson;\n}\n\nexport { flip };\nexport default flip;\n"]}
1
+ {"version":3,"sources":["/home/runner/work/turf/turf/packages/turf-flip/dist/cjs/index.cjs","../../index.ts"],"names":[],"mappings":"AAAA;ACAA,kCAA0B;AAC1B,wCAAqC;AACrC,oCAAsB;AAkBtB,SAAS,IAAA,CACP,OAAA,EACA,OAAA,EAGG;AAzBL,EAAA,IAAA,EAAA;AA2BE,EAAA,QAAA,EAAU,QAAA,GAAW,CAAC,CAAA;AACtB,EAAA,GAAA,CAAI,CAAC,+BAAA,OAAgB,CAAA,EAAG,MAAM,IAAI,KAAA,CAAM,oBAAoB,CAAA;AAC5D,EAAA,MAAM,OAAA,EAAA,CAAS,GAAA,EAAA,OAAA,CAAQ,MAAA,EAAA,GAAR,KAAA,EAAA,GAAA,EAAkB,KAAA;AAEjC,EAAA,GAAA,CAAI,CAAC,OAAA,EAAS,MAAM,IAAI,KAAA,CAAM,qBAAqB,CAAA;AAInD,EAAA,GAAA,CAAI,OAAA,IAAW,MAAA,GAAS,OAAA,IAAW,KAAA,CAAA,EAAW,QAAA,EAAU,0BAAA,OAAa,CAAA;AAErE,EAAA,6BAAA,OAAU,EAAS,QAAA,CAAU,KAAA,EAAO;AAClC,IAAA,IAAI,EAAA,EAAI,KAAA,CAAM,CAAC,CAAA;AACf,IAAA,IAAI,EAAA,EAAI,KAAA,CAAM,CAAC,CAAA;AACf,IAAA,KAAA,CAAM,CAAC,EAAA,EAAI,CAAA;AACX,IAAA,KAAA,CAAM,CAAC,EAAA,EAAI,CAAA;AAAA,EACb,CAAC,CAAA;AACD,EAAA,OAAO,OAAA;AACT;AAGA,IAAO,cAAA,EAAQ,IAAA;AD3Bf;AACE;AACA;AACF,qDAAC","file":"/home/runner/work/turf/turf/packages/turf-flip/dist/cjs/index.cjs","sourcesContent":[null,"import { coordEach } from \"@turf/meta\";\nimport { isObject, AllGeoJSON } from \"@turf/helpers\";\nimport { clone } from \"@turf/clone\";\n\n/**\n * Takes input features and flips all of their coordinates from `[x, y]` to `[y, x]`.\n *\n * @function\n * @param {GeoJSON} geojson input features\n * @param {Object} [options={}] Optional parameters\n * @param {boolean} [options.mutate=false] allows GeoJSON input to be mutated (significant performance increase if true)\n * @returns {GeoJSON} a feature or set of features of the same type as `input` with flipped coordinates\n * @example\n * var serbia = turf.point([20.566406, 43.421008]);\n *\n * var saudiArabia = turf.flip(serbia);\n *\n * //addToMap\n * var addToMap = [serbia, saudiArabia];\n */\nfunction flip<T extends AllGeoJSON>(\n geojson: T,\n options?: {\n mutate?: boolean;\n }\n): T {\n // Optional parameters\n options = options || {};\n if (!isObject(options)) throw new Error(\"options is invalid\");\n const mutate = options.mutate ?? false;\n\n if (!geojson) throw new Error(\"geojson is required\");\n // ensure that we don't modify features in-place and changes to the\n // output do not change the previous feature, including changes to nested\n // properties.\n if (mutate === false || mutate === undefined) geojson = clone(geojson);\n\n coordEach(geojson, function (coord) {\n var x = coord[0];\n var y = coord[1];\n coord[0] = y;\n coord[1] = x;\n });\n return geojson;\n}\n\nexport { flip };\nexport default flip;\n"]}
package/dist/esm/index.js CHANGED
@@ -17,9 +17,9 @@ function flip(geojson, options) {
17
17
  });
18
18
  return geojson;
19
19
  }
20
- var turf_flip_default = flip;
20
+ var index_default = flip;
21
21
  export {
22
- turf_flip_default as default,
22
+ index_default as default,
23
23
  flip
24
24
  };
25
25
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../index.ts"],"sourcesContent":["import { coordEach } from \"@turf/meta\";\nimport { isObject, AllGeoJSON } from \"@turf/helpers\";\nimport { clone } from \"@turf/clone\";\n\n/**\n * Takes input features and flips all of their coordinates from `[x, y]` to `[y, x]`.\n *\n * @function\n * @param {GeoJSON} geojson input features\n * @param {Object} [options={}] Optional parameters\n * @param {boolean} [options.mutate=false] allows GeoJSON input to be mutated (significant performance increase if true)\n * @returns {GeoJSON} a feature or set of features of the same type as `input` with flipped coordinates\n * @example\n * var serbia = turf.point([20.566406, 43.421008]);\n *\n * var saudiArabia = turf.flip(serbia);\n *\n * //addToMap\n * var addToMap = [serbia, saudiArabia];\n */\nfunction flip<T extends AllGeoJSON>(\n geojson: T,\n options?: {\n mutate?: boolean;\n }\n): T {\n // Optional parameters\n options = options || {};\n if (!isObject(options)) throw new Error(\"options is invalid\");\n const mutate = options.mutate ?? false;\n\n if (!geojson) throw new Error(\"geojson is required\");\n // ensure that we don't modify features in-place and changes to the\n // output do not change the previous feature, including changes to nested\n // properties.\n if (mutate === false || mutate === undefined) geojson = clone(geojson);\n\n coordEach(geojson, function (coord) {\n var x = coord[0];\n var y = coord[1];\n coord[0] = y;\n coord[1] = x;\n });\n return geojson;\n}\n\nexport { flip };\nexport default flip;\n"],"mappings":";AAAA,SAAS,iBAAiB;AAC1B,SAAS,gBAA4B;AACrC,SAAS,aAAa;AAkBtB,SAAS,KACP,SACA,SAGG;AAzBL;AA2BE,YAAU,WAAW,CAAC;AACtB,MAAI,CAAC,SAAS,OAAO,EAAG,OAAM,IAAI,MAAM,oBAAoB;AAC5D,QAAM,UAAS,aAAQ,WAAR,YAAkB;AAEjC,MAAI,CAAC,QAAS,OAAM,IAAI,MAAM,qBAAqB;AAInD,MAAI,WAAW,SAAS,WAAW,OAAW,WAAU,MAAM,OAAO;AAErE,YAAU,SAAS,SAAU,OAAO;AAClC,QAAI,IAAI,MAAM,CAAC;AACf,QAAI,IAAI,MAAM,CAAC;AACf,UAAM,CAAC,IAAI;AACX,UAAM,CAAC,IAAI;AAAA,EACb,CAAC;AACD,SAAO;AACT;AAGA,IAAO,oBAAQ;","names":[]}
1
+ {"version":3,"sources":["../../index.ts"],"sourcesContent":["import { coordEach } from \"@turf/meta\";\nimport { isObject, AllGeoJSON } from \"@turf/helpers\";\nimport { clone } from \"@turf/clone\";\n\n/**\n * Takes input features and flips all of their coordinates from `[x, y]` to `[y, x]`.\n *\n * @function\n * @param {GeoJSON} geojson input features\n * @param {Object} [options={}] Optional parameters\n * @param {boolean} [options.mutate=false] allows GeoJSON input to be mutated (significant performance increase if true)\n * @returns {GeoJSON} a feature or set of features of the same type as `input` with flipped coordinates\n * @example\n * var serbia = turf.point([20.566406, 43.421008]);\n *\n * var saudiArabia = turf.flip(serbia);\n *\n * //addToMap\n * var addToMap = [serbia, saudiArabia];\n */\nfunction flip<T extends AllGeoJSON>(\n geojson: T,\n options?: {\n mutate?: boolean;\n }\n): T {\n // Optional parameters\n options = options || {};\n if (!isObject(options)) throw new Error(\"options is invalid\");\n const mutate = options.mutate ?? false;\n\n if (!geojson) throw new Error(\"geojson is required\");\n // ensure that we don't modify features in-place and changes to the\n // output do not change the previous feature, including changes to nested\n // properties.\n if (mutate === false || mutate === undefined) geojson = clone(geojson);\n\n coordEach(geojson, function (coord) {\n var x = coord[0];\n var y = coord[1];\n coord[0] = y;\n coord[1] = x;\n });\n return geojson;\n}\n\nexport { flip };\nexport default flip;\n"],"mappings":";AAAA,SAAS,iBAAiB;AAC1B,SAAS,gBAA4B;AACrC,SAAS,aAAa;AAkBtB,SAAS,KACP,SACA,SAGG;AAzBL;AA2BE,YAAU,WAAW,CAAC;AACtB,MAAI,CAAC,SAAS,OAAO,EAAG,OAAM,IAAI,MAAM,oBAAoB;AAC5D,QAAM,UAAS,aAAQ,WAAR,YAAkB;AAEjC,MAAI,CAAC,QAAS,OAAM,IAAI,MAAM,qBAAqB;AAInD,MAAI,WAAW,SAAS,WAAW,OAAW,WAAU,MAAM,OAAO;AAErE,YAAU,SAAS,SAAU,OAAO;AAClC,QAAI,IAAI,MAAM,CAAC;AACf,QAAI,IAAI,MAAM,CAAC;AACf,UAAM,CAAC,IAAI;AACX,UAAM,CAAC,IAAI;AAAA,EACb,CAAC;AACD,SAAO;AACT;AAGA,IAAO,gBAAQ;","names":[]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@turf/flip",
3
- "version": "7.2.0",
4
- "description": "turf flip module",
3
+ "version": "7.3.1",
4
+ "description": "Takes input features and flips all of their coordinates.",
5
5
  "author": "Turf Authors",
6
6
  "license": "MIT",
7
7
  "bugs": {
@@ -47,28 +47,27 @@
47
47
  "bench": "tsx bench.ts",
48
48
  "build": "tsup --config ../../tsup.config.ts",
49
49
  "docs": "tsx ../../scripts/generate-readmes.ts",
50
- "test": "npm-run-all --npm-path npm test:*",
50
+ "test": "pnpm run /test:.*/",
51
51
  "test:tape": "tsx test.ts",
52
52
  "test:types": "tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts"
53
53
  },
54
54
  "devDependencies": {
55
55
  "@types/benchmark": "^2.1.5",
56
- "@types/tape": "^4.13.4",
56
+ "@types/tape": "^5.8.1",
57
57
  "benchmark": "^2.1.4",
58
58
  "load-json-file": "^7.0.1",
59
- "npm-run-all": "^4.1.5",
60
59
  "tape": "^5.9.0",
61
- "tsup": "^8.3.5",
62
- "tsx": "^4.19.2",
63
- "typescript": "^5.5.4",
64
- "write-json-file": "^5.0.0"
60
+ "tsup": "^8.4.0",
61
+ "tsx": "^4.19.4",
62
+ "typescript": "^5.8.3",
63
+ "write-json-file": "^6.0.0"
65
64
  },
66
65
  "dependencies": {
67
- "@turf/clone": "^7.2.0",
68
- "@turf/helpers": "^7.2.0",
69
- "@turf/meta": "^7.2.0",
66
+ "@turf/clone": "7.3.1",
67
+ "@turf/helpers": "7.3.1",
68
+ "@turf/meta": "7.3.1",
70
69
  "@types/geojson": "^7946.0.10",
71
70
  "tslib": "^2.8.1"
72
71
  },
73
- "gitHead": "7b0f0374c4668cd569f8904c71e2ae7d941be867"
72
+ "gitHead": "b7f1b4eafb760431e03955499d8eac9489438219"
74
73
  }