@turf/transform-scale 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 -7
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/index.js +0 -6
- package/dist/esm/index.js.map +1 -1
- package/package.json +15 -15
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.js
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// index.js
|
|
5
2
|
var _clone = require('@turf/clone');
|
|
6
3
|
var _center = require('@turf/center');
|
|
7
4
|
var _centroid = require('@turf/centroid');
|
|
@@ -33,7 +30,6 @@ function transformScale(geojson, factor, options) {
|
|
|
33
30
|
}
|
|
34
31
|
return scale(geojson, factor, origin);
|
|
35
32
|
}
|
|
36
|
-
__name(transformScale, "transformScale");
|
|
37
33
|
function scale(feature, factor, origin) {
|
|
38
34
|
var isPoint = _invariant.getType.call(void 0, feature) === "Point";
|
|
39
35
|
origin = defineOrigin(feature, origin);
|
|
@@ -52,7 +48,6 @@ function scale(feature, factor, origin) {
|
|
|
52
48
|
delete feature.bbox;
|
|
53
49
|
return feature;
|
|
54
50
|
}
|
|
55
|
-
__name(scale, "scale");
|
|
56
51
|
function defineOrigin(geojson, origin) {
|
|
57
52
|
if (origin === void 0 || origin === null)
|
|
58
53
|
origin = "centroid";
|
|
@@ -94,7 +89,6 @@ function defineOrigin(geojson, origin) {
|
|
|
94
89
|
throw new Error("invalid origin");
|
|
95
90
|
}
|
|
96
91
|
}
|
|
97
|
-
__name(defineOrigin, "defineOrigin");
|
|
98
92
|
var turf_transform_scale_default = transformScale;
|
|
99
93
|
|
|
100
94
|
|
package/dist/cjs/index.cjs.map
CHANGED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EACpC;AACF;AAGA,IAAO,+BAAQ","sourcesContent":["import { clone } from \"@turf/clone\";\nimport { center } from \"@turf/center\";\nimport { centroid } from \"@turf/centroid\";\nimport { bbox as turfBBox } from \"@turf/bbox\";\nimport { rhumbBearing } from \"@turf/rhumb-bearing\";\nimport { rhumbDistance } from \"@turf/rhumb-distance\";\nimport { rhumbDestination } from \"@turf/rhumb-destination\";\nimport { coordEach, featureEach } from \"@turf/meta\";\nimport { point, isObject } from \"@turf/helpers\";\nimport { getCoord, getCoords, getType } from \"@turf/invariant\";\n\n/**\n * Scale a GeoJSON from a given point by a factor of scaling (ex: factor=2 would make the GeoJSON 200% larger).\n * If a FeatureCollection is provided, the origin point will be calculated based on each individual Feature.\n *\n * @name transformScale\n * @param {GeoJSON} geojson GeoJSON to be scaled\n * @param {number} factor of scaling, positive values greater than 0. Numbers between 0 and 1 will shrink the geojson, numbers greater than 1 will expand it, a factor of 1 will not change the geojson.\n * @param {Object} [options={}] Optional parameters\n * @param {string|Coord} [options.origin='centroid'] Point from which the scaling will occur (string options: sw/se/nw/ne/center/centroid)\n * @param {boolean} [options.mutate=false] allows GeoJSON input to be mutated (significant performance increase if true)\n * @returns {GeoJSON} scaled GeoJSON\n * @example\n * var poly = turf.polygon([[[0,29],[3.5,29],[2.5,32],[0,29]]]);\n * var scaledPoly = turf.transformScale(poly, 3);\n *\n * //addToMap\n * var addToMap = [poly, scaledPoly];\n * scaledPoly.properties = {stroke: '#F00', 'stroke-width': 4};\n */\nfunction transformScale(geojson, factor, options) {\n // Optional parameters\n options = options || {};\n if (!isObject(options)) throw new Error(\"options is invalid\");\n var origin = options.origin;\n var mutate = options.mutate;\n\n // Input validation\n if (!geojson) throw new Error(\"geojson required\");\n if (typeof factor !== \"number\" || factor <= 0)\n throw new Error(\"invalid factor\");\n var originIsPoint = Array.isArray(origin) || typeof origin === \"object\";\n\n // Clone geojson to avoid side effects\n if (mutate !== true) geojson = clone(geojson);\n\n // Scale each Feature separately\n if (geojson.type === \"FeatureCollection\" && !originIsPoint) {\n featureEach(geojson, function (feature, index) {\n geojson.features[index] = scale(feature, factor, origin);\n });\n return geojson;\n }\n // Scale Feature/Geometry\n return scale(geojson, factor, origin);\n}\n\n/**\n * Scale Feature/Geometry\n *\n * @private\n * @param {Feature|Geometry} feature GeoJSON Feature/Geometry\n * @param {number} factor of scaling, positive or negative values greater than 0\n * @param {string|Coord} [origin=\"centroid\"] Point from which the scaling will occur (string options: sw/se/nw/ne/center/centroid)\n * @returns {Feature|Geometry} scaled GeoJSON Feature/Geometry\n */\nfunction scale(feature, factor, origin) {\n // Default params\n var isPoint = getType(feature) === \"Point\";\n origin = defineOrigin(feature, origin);\n\n // Shortcut no-scaling\n if (factor === 1 || isPoint) return feature;\n\n // Scale each coordinate\n coordEach(feature, function (coord) {\n var originalDistance = rhumbDistance(origin, coord);\n var bearing = rhumbBearing(origin, coord);\n var newDistance = originalDistance * factor;\n var newCoord = getCoords(rhumbDestination(origin, newDistance, bearing));\n coord[0] = newCoord[0];\n coord[1] = newCoord[1];\n if (coord.length === 3) coord[2] *= factor;\n });\n\n delete feature.bbox;\n\n return feature;\n}\n\n/**\n * Define Origin\n *\n * @private\n * @param {GeoJSON} geojson GeoJSON\n * @param {string|Coord} origin sw/se/nw/ne/center/centroid\n * @returns {Feature<Point>} Point origin\n */\nfunction defineOrigin(geojson, origin) {\n // Default params\n if (origin === undefined || origin === null) origin = \"centroid\";\n\n // Input Coord\n if (Array.isArray(origin) || typeof origin === \"object\")\n return getCoord(origin);\n\n // Define BBox\n var bbox = geojson.bbox\n ? geojson.bbox\n : turfBBox(geojson, { recalculate: true });\n var west = bbox[0];\n var south = bbox[1];\n var east = bbox[2];\n var north = bbox[3];\n\n switch (origin) {\n case \"sw\":\n case \"southwest\":\n case \"westsouth\":\n case \"bottomleft\":\n return point([west, south]);\n case \"se\":\n case \"southeast\":\n case \"eastsouth\":\n case \"bottomright\":\n return point([east, south]);\n case \"nw\":\n case \"northwest\":\n case \"westnorth\":\n case \"topleft\":\n return point([west, north]);\n case \"ne\":\n case \"northeast\":\n case \"eastnorth\":\n case \"topright\":\n return point([east, north]);\n case \"center\":\n return center(geojson);\n case undefined:\n case null:\n case \"centroid\":\n return centroid(geojson);\n default:\n throw new Error(\"invalid origin\");\n }\n}\n\nexport { transformScale };\nexport default transformScale;\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.js
|
|
5
2
|
import { clone } from "@turf/clone";
|
|
6
3
|
import { center } from "@turf/center";
|
|
@@ -33,7 +30,6 @@ function transformScale(geojson, factor, options) {
|
|
|
33
30
|
}
|
|
34
31
|
return scale(geojson, factor, origin);
|
|
35
32
|
}
|
|
36
|
-
__name(transformScale, "transformScale");
|
|
37
33
|
function scale(feature, factor, origin) {
|
|
38
34
|
var isPoint = getType(feature) === "Point";
|
|
39
35
|
origin = defineOrigin(feature, origin);
|
|
@@ -52,7 +48,6 @@ function scale(feature, factor, origin) {
|
|
|
52
48
|
delete feature.bbox;
|
|
53
49
|
return feature;
|
|
54
50
|
}
|
|
55
|
-
__name(scale, "scale");
|
|
56
51
|
function defineOrigin(geojson, origin) {
|
|
57
52
|
if (origin === void 0 || origin === null)
|
|
58
53
|
origin = "centroid";
|
|
@@ -94,7 +89,6 @@ function defineOrigin(geojson, origin) {
|
|
|
94
89
|
throw new Error("invalid origin");
|
|
95
90
|
}
|
|
96
91
|
}
|
|
97
|
-
__name(defineOrigin, "defineOrigin");
|
|
98
92
|
var turf_transform_scale_default = transformScale;
|
|
99
93
|
export {
|
|
100
94
|
turf_transform_scale_default as default,
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../index.js"],"sourcesContent":["import { clone } from \"@turf/clone\";\nimport { center } from \"@turf/center\";\nimport { centroid } from \"@turf/centroid\";\nimport { bbox as turfBBox } from \"@turf/bbox\";\nimport { rhumbBearing } from \"@turf/rhumb-bearing\";\nimport { rhumbDistance } from \"@turf/rhumb-distance\";\nimport { rhumbDestination } from \"@turf/rhumb-destination\";\nimport { coordEach, featureEach } from \"@turf/meta\";\nimport { point, isObject } from \"@turf/helpers\";\nimport { getCoord, getCoords, getType } from \"@turf/invariant\";\n\n/**\n * Scale a GeoJSON from a given point by a factor of scaling (ex: factor=2 would make the GeoJSON 200% larger).\n * If a FeatureCollection is provided, the origin point will be calculated based on each individual Feature.\n *\n * @name transformScale\n * @param {GeoJSON} geojson GeoJSON to be scaled\n * @param {number} factor of scaling, positive values greater than 0. Numbers between 0 and 1 will shrink the geojson, numbers greater than 1 will expand it, a factor of 1 will not change the geojson.\n * @param {Object} [options={}] Optional parameters\n * @param {string|Coord} [options.origin='centroid'] Point from which the scaling will occur (string options: sw/se/nw/ne/center/centroid)\n * @param {boolean} [options.mutate=false] allows GeoJSON input to be mutated (significant performance increase if true)\n * @returns {GeoJSON} scaled GeoJSON\n * @example\n * var poly = turf.polygon([[[0,29],[3.5,29],[2.5,32],[0,29]]]);\n * var scaledPoly = turf.transformScale(poly, 3);\n *\n * //addToMap\n * var addToMap = [poly, scaledPoly];\n * scaledPoly.properties = {stroke: '#F00', 'stroke-width': 4};\n */\nfunction transformScale(geojson, factor, options) {\n // Optional parameters\n options = options || {};\n if (!isObject(options)) throw new Error(\"options is invalid\");\n var origin = options.origin;\n var mutate = options.mutate;\n\n // Input validation\n if (!geojson) throw new Error(\"geojson required\");\n if (typeof factor !== \"number\" || factor <= 0)\n throw new Error(\"invalid factor\");\n var originIsPoint = Array.isArray(origin) || typeof origin === \"object\";\n\n // Clone geojson to avoid side effects\n if (mutate !== true) geojson = clone(geojson);\n\n // Scale each Feature separately\n if (geojson.type === \"FeatureCollection\" && !originIsPoint) {\n featureEach(geojson, function (feature, index) {\n geojson.features[index] = scale(feature, factor, origin);\n });\n return geojson;\n }\n // Scale Feature/Geometry\n return scale(geojson, factor, origin);\n}\n\n/**\n * Scale Feature/Geometry\n *\n * @private\n * @param {Feature|Geometry} feature GeoJSON Feature/Geometry\n * @param {number} factor of scaling, positive or negative values greater than 0\n * @param {string|Coord} [origin=\"centroid\"] Point from which the scaling will occur (string options: sw/se/nw/ne/center/centroid)\n * @returns {Feature|Geometry} scaled GeoJSON Feature/Geometry\n */\nfunction scale(feature, factor, origin) {\n // Default params\n var isPoint = getType(feature) === \"Point\";\n origin = defineOrigin(feature, origin);\n\n // Shortcut no-scaling\n if (factor === 1 || isPoint) return feature;\n\n // Scale each coordinate\n coordEach(feature, function (coord) {\n var originalDistance = rhumbDistance(origin, coord);\n var bearing = rhumbBearing(origin, coord);\n var newDistance = originalDistance * factor;\n var newCoord = getCoords(rhumbDestination(origin, newDistance, bearing));\n coord[0] = newCoord[0];\n coord[1] = newCoord[1];\n if (coord.length === 3) coord[2] *= factor;\n });\n\n delete feature.bbox;\n\n return feature;\n}\n\n/**\n * Define Origin\n *\n * @private\n * @param {GeoJSON} geojson GeoJSON\n * @param {string|Coord} origin sw/se/nw/ne/center/centroid\n * @returns {Feature<Point>} Point origin\n */\nfunction defineOrigin(geojson, origin) {\n // Default params\n if (origin === undefined || origin === null) origin = \"centroid\";\n\n // Input Coord\n if (Array.isArray(origin) || typeof origin === \"object\")\n return getCoord(origin);\n\n // Define BBox\n var bbox = geojson.bbox\n ? geojson.bbox\n : turfBBox(geojson, { recalculate: true });\n var west = bbox[0];\n var south = bbox[1];\n var east = bbox[2];\n var north = bbox[3];\n\n switch (origin) {\n case \"sw\":\n case \"southwest\":\n case \"westsouth\":\n case \"bottomleft\":\n return point([west, south]);\n case \"se\":\n case \"southeast\":\n case \"eastsouth\":\n case \"bottomright\":\n return point([east, south]);\n case \"nw\":\n case \"northwest\":\n case \"westnorth\":\n case \"topleft\":\n return point([west, north]);\n case \"ne\":\n case \"northeast\":\n case \"eastnorth\":\n case \"topright\":\n return point([east, north]);\n case \"center\":\n return center(geojson);\n case undefined:\n case null:\n case \"centroid\":\n return centroid(geojson);\n default:\n throw new Error(\"invalid origin\");\n }\n}\n\nexport { transformScale };\nexport default transformScale;\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../index.js"],"sourcesContent":["import { clone } from \"@turf/clone\";\nimport { center } from \"@turf/center\";\nimport { centroid } from \"@turf/centroid\";\nimport { bbox as turfBBox } from \"@turf/bbox\";\nimport { rhumbBearing } from \"@turf/rhumb-bearing\";\nimport { rhumbDistance } from \"@turf/rhumb-distance\";\nimport { rhumbDestination } from \"@turf/rhumb-destination\";\nimport { coordEach, featureEach } from \"@turf/meta\";\nimport { point, isObject } from \"@turf/helpers\";\nimport { getCoord, getCoords, getType } from \"@turf/invariant\";\n\n/**\n * Scale a GeoJSON from a given point by a factor of scaling (ex: factor=2 would make the GeoJSON 200% larger).\n * If a FeatureCollection is provided, the origin point will be calculated based on each individual Feature.\n *\n * @name transformScale\n * @param {GeoJSON} geojson GeoJSON to be scaled\n * @param {number} factor of scaling, positive values greater than 0. Numbers between 0 and 1 will shrink the geojson, numbers greater than 1 will expand it, a factor of 1 will not change the geojson.\n * @param {Object} [options={}] Optional parameters\n * @param {string|Coord} [options.origin='centroid'] Point from which the scaling will occur (string options: sw/se/nw/ne/center/centroid)\n * @param {boolean} [options.mutate=false] allows GeoJSON input to be mutated (significant performance increase if true)\n * @returns {GeoJSON} scaled GeoJSON\n * @example\n * var poly = turf.polygon([[[0,29],[3.5,29],[2.5,32],[0,29]]]);\n * var scaledPoly = turf.transformScale(poly, 3);\n *\n * //addToMap\n * var addToMap = [poly, scaledPoly];\n * scaledPoly.properties = {stroke: '#F00', 'stroke-width': 4};\n */\nfunction transformScale(geojson, factor, options) {\n // Optional parameters\n options = options || {};\n if (!isObject(options)) throw new Error(\"options is invalid\");\n var origin = options.origin;\n var mutate = options.mutate;\n\n // Input validation\n if (!geojson) throw new Error(\"geojson required\");\n if (typeof factor !== \"number\" || factor <= 0)\n throw new Error(\"invalid factor\");\n var originIsPoint = Array.isArray(origin) || typeof origin === \"object\";\n\n // Clone geojson to avoid side effects\n if (mutate !== true) geojson = clone(geojson);\n\n // Scale each Feature separately\n if (geojson.type === \"FeatureCollection\" && !originIsPoint) {\n featureEach(geojson, function (feature, index) {\n geojson.features[index] = scale(feature, factor, origin);\n });\n return geojson;\n }\n // Scale Feature/Geometry\n return scale(geojson, factor, origin);\n}\n\n/**\n * Scale Feature/Geometry\n *\n * @private\n * @param {Feature|Geometry} feature GeoJSON Feature/Geometry\n * @param {number} factor of scaling, positive or negative values greater than 0\n * @param {string|Coord} [origin=\"centroid\"] Point from which the scaling will occur (string options: sw/se/nw/ne/center/centroid)\n * @returns {Feature|Geometry} scaled GeoJSON Feature/Geometry\n */\nfunction scale(feature, factor, origin) {\n // Default params\n var isPoint = getType(feature) === \"Point\";\n origin = defineOrigin(feature, origin);\n\n // Shortcut no-scaling\n if (factor === 1 || isPoint) return feature;\n\n // Scale each coordinate\n coordEach(feature, function (coord) {\n var originalDistance = rhumbDistance(origin, coord);\n var bearing = rhumbBearing(origin, coord);\n var newDistance = originalDistance * factor;\n var newCoord = getCoords(rhumbDestination(origin, newDistance, bearing));\n coord[0] = newCoord[0];\n coord[1] = newCoord[1];\n if (coord.length === 3) coord[2] *= factor;\n });\n\n delete feature.bbox;\n\n return feature;\n}\n\n/**\n * Define Origin\n *\n * @private\n * @param {GeoJSON} geojson GeoJSON\n * @param {string|Coord} origin sw/se/nw/ne/center/centroid\n * @returns {Feature<Point>} Point origin\n */\nfunction defineOrigin(geojson, origin) {\n // Default params\n if (origin === undefined || origin === null) origin = \"centroid\";\n\n // Input Coord\n if (Array.isArray(origin) || typeof origin === \"object\")\n return getCoord(origin);\n\n // Define BBox\n var bbox = geojson.bbox\n ? geojson.bbox\n : turfBBox(geojson, { recalculate: true });\n var west = bbox[0];\n var south = bbox[1];\n var east = bbox[2];\n var north = bbox[3];\n\n switch (origin) {\n case \"sw\":\n case \"southwest\":\n case \"westsouth\":\n case \"bottomleft\":\n return point([west, south]);\n case \"se\":\n case \"southeast\":\n case \"eastsouth\":\n case \"bottomright\":\n return point([east, south]);\n case \"nw\":\n case \"northwest\":\n case \"westnorth\":\n case \"topleft\":\n return point([west, north]);\n case \"ne\":\n case \"northeast\":\n case \"eastnorth\":\n case \"topright\":\n return point([east, north]);\n case \"center\":\n return center(geojson);\n case undefined:\n case null:\n case \"centroid\":\n return centroid(geojson);\n default:\n throw new Error(\"invalid origin\");\n }\n}\n\nexport { transformScale };\nexport default transformScale;\n"],"mappings":";AAAA,SAAS,aAAa;AACtB,SAAS,cAAc;AACvB,SAAS,gBAAgB;AACzB,SAAS,QAAQ,gBAAgB;AACjC,SAAS,oBAAoB;AAC7B,SAAS,qBAAqB;AAC9B,SAAS,wBAAwB;AACjC,SAAS,WAAW,mBAAmB;AACvC,SAAS,OAAO,gBAAgB;AAChC,SAAS,UAAU,WAAW,eAAe;AAqB7C,SAAS,eAAe,SAAS,QAAQ,SAAS;AAEhD,YAAU,WAAW,CAAC;AACtB,MAAI,CAAC,SAAS,OAAO;AAAG,UAAM,IAAI,MAAM,oBAAoB;AAC5D,MAAI,SAAS,QAAQ;AACrB,MAAI,SAAS,QAAQ;AAGrB,MAAI,CAAC;AAAS,UAAM,IAAI,MAAM,kBAAkB;AAChD,MAAI,OAAO,WAAW,YAAY,UAAU;AAC1C,UAAM,IAAI,MAAM,gBAAgB;AAClC,MAAI,gBAAgB,MAAM,QAAQ,MAAM,KAAK,OAAO,WAAW;AAG/D,MAAI,WAAW;AAAM,cAAU,MAAM,OAAO;AAG5C,MAAI,QAAQ,SAAS,uBAAuB,CAAC,eAAe;AAC1D,gBAAY,SAAS,SAAU,SAAS,OAAO;AAC7C,cAAQ,SAAS,KAAK,IAAI,MAAM,SAAS,QAAQ,MAAM;AAAA,IACzD,CAAC;AACD,WAAO;AAAA,EACT;AAEA,SAAO,MAAM,SAAS,QAAQ,MAAM;AACtC;AAWA,SAAS,MAAM,SAAS,QAAQ,QAAQ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AA,IACL,KAAK;AACH,aAAO,MAAM,CAAC,MAAM,KAAK,CAAC;AAAA,IAC5B,KAAK;AACH,aAAO,OAAO,OAAO;AAAA,IACvB,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AACH,aAAO,SAAS,OAAO;AAAA,IACzB;AACE,YAAM,IAAI,MAAM,gBAAgB;AAAA,EACpC;AACF;AAGA,IAAO,+BAAQ;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@turf/transform-scale",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.1.0-alpha.7+0ce6ecca0",
|
|
4
4
|
"description": "turf transform-scale module",
|
|
5
5
|
"author": "Turf Authors",
|
|
6
6
|
"contributors": [
|
|
@@ -60,9 +60,9 @@
|
|
|
60
60
|
"test:types": "tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
|
-
"@turf/bbox-polygon": "^7.0.
|
|
64
|
-
"@turf/hex-grid": "^7.0.
|
|
65
|
-
"@turf/truncate": "^7.0.
|
|
63
|
+
"@turf/bbox-polygon": "^7.1.0-alpha.7+0ce6ecca0",
|
|
64
|
+
"@turf/hex-grid": "^7.1.0-alpha.7+0ce6ecca0",
|
|
65
|
+
"@turf/truncate": "^7.1.0-alpha.7+0ce6ecca0",
|
|
66
66
|
"@types/benchmark": "^2.1.5",
|
|
67
67
|
"@types/tape": "^4.2.32",
|
|
68
68
|
"benchmark": "^2.1.4",
|
|
@@ -74,16 +74,16 @@
|
|
|
74
74
|
"write-json-file": "^5.0.0"
|
|
75
75
|
},
|
|
76
76
|
"dependencies": {
|
|
77
|
-
"@turf/bbox": "^7.0.
|
|
78
|
-
"@turf/center": "^7.0.
|
|
79
|
-
"@turf/centroid": "^7.0.
|
|
80
|
-
"@turf/clone": "^7.0.
|
|
81
|
-
"@turf/helpers": "^7.0.
|
|
82
|
-
"@turf/invariant": "^7.0.
|
|
83
|
-
"@turf/meta": "^7.0.
|
|
84
|
-
"@turf/rhumb-bearing": "^7.0.
|
|
85
|
-
"@turf/rhumb-destination": "^7.0.
|
|
86
|
-
"@turf/rhumb-distance": "^7.0.
|
|
77
|
+
"@turf/bbox": "^7.1.0-alpha.7+0ce6ecca0",
|
|
78
|
+
"@turf/center": "^7.1.0-alpha.7+0ce6ecca0",
|
|
79
|
+
"@turf/centroid": "^7.1.0-alpha.7+0ce6ecca0",
|
|
80
|
+
"@turf/clone": "^7.1.0-alpha.7+0ce6ecca0",
|
|
81
|
+
"@turf/helpers": "^7.1.0-alpha.7+0ce6ecca0",
|
|
82
|
+
"@turf/invariant": "^7.1.0-alpha.7+0ce6ecca0",
|
|
83
|
+
"@turf/meta": "^7.1.0-alpha.7+0ce6ecca0",
|
|
84
|
+
"@turf/rhumb-bearing": "^7.1.0-alpha.7+0ce6ecca0",
|
|
85
|
+
"@turf/rhumb-destination": "^7.1.0-alpha.7+0ce6ecca0",
|
|
86
|
+
"@turf/rhumb-distance": "^7.1.0-alpha.7+0ce6ecca0"
|
|
87
87
|
},
|
|
88
|
-
"gitHead": "
|
|
88
|
+
"gitHead": "0ce6ecca05829690270fec6d6bed2003495fe0ea"
|
|
89
89
|
}
|