@turf/flip 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 +5 -5
package/dist/cjs/index.cjs
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true})
|
|
2
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
-
|
|
4
|
-
// index.ts
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// index.ts
|
|
5
2
|
var _meta = require('@turf/meta');
|
|
6
3
|
var _helpers = require('@turf/helpers');
|
|
7
4
|
var _clone = require('@turf/clone');
|
|
@@ -23,7 +20,6 @@ function flip(geojson, options) {
|
|
|
23
20
|
});
|
|
24
21
|
return geojson;
|
|
25
22
|
}
|
|
26
|
-
__name(flip, "flip");
|
|
27
23
|
var turf_flip_default = flip;
|
|
28
24
|
|
|
29
25
|
|
package/dist/cjs/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../index.ts"],"names":[],"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;AAAG,UAAM,IAAI,MAAM,oBAAoB;AAC5D,QAAM,UAAS,aAAQ,WAAR,YAAkB;AAEjC,MAAI,CAAC;AAAS,UAAM,IAAI,MAAM,qBAAqB;AAInD,MAAI,WAAW,SAAS,WAAW;AAAW,cAAU,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","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 * @name flip\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
|
@@ -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 { coordEach } from "@turf/meta";
|
|
6
3
|
import { isObject } from "@turf/helpers";
|
|
@@ -23,7 +20,6 @@ function flip(geojson, options) {
|
|
|
23
20
|
});
|
|
24
21
|
return geojson;
|
|
25
22
|
}
|
|
26
|
-
__name(flip, "flip");
|
|
27
23
|
var turf_flip_default = flip;
|
|
28
24
|
export {
|
|
29
25
|
turf_flip_default as default,
|
package/dist/esm/index.js.map
CHANGED
|
@@ -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 * @name flip\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":"
|
|
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 * @name flip\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;AAAG,UAAM,IAAI,MAAM,oBAAoB;AAC5D,QAAM,UAAS,aAAQ,WAAR,YAAkB;AAEjC,MAAI,CAAC;AAAS,UAAM,IAAI,MAAM,qBAAqB;AAInD,MAAI,WAAW,SAAS,WAAW;AAAW,cAAU,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":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@turf/flip",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.1.0-alpha.7+0ce6ecca0",
|
|
4
4
|
"description": "turf flip module",
|
|
5
5
|
"author": "Turf Authors",
|
|
6
6
|
"license": "MIT",
|
|
@@ -64,10 +64,10 @@
|
|
|
64
64
|
"write-json-file": "^5.0.0"
|
|
65
65
|
},
|
|
66
66
|
"dependencies": {
|
|
67
|
-
"@turf/clone": "^7.0.
|
|
68
|
-
"@turf/helpers": "^7.0.
|
|
69
|
-
"@turf/meta": "^7.0.
|
|
67
|
+
"@turf/clone": "^7.1.0-alpha.7+0ce6ecca0",
|
|
68
|
+
"@turf/helpers": "^7.1.0-alpha.7+0ce6ecca0",
|
|
69
|
+
"@turf/meta": "^7.1.0-alpha.7+0ce6ecca0",
|
|
70
70
|
"tslib": "^2.6.2"
|
|
71
71
|
},
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "0ce6ecca05829690270fec6d6bed2003495fe0ea"
|
|
73
73
|
}
|