@turf/square 7.1.0-alpha.70 → 7.2.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.
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.cts +1 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js.map +1 -1
- package/package.json +10 -10
package/dist/cjs/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../index.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/turf/turf/packages/turf-square/dist/cjs/index.cjs","../../index.ts"],"names":[],"mappings":"AAAA;ACAA,0CAAyB;AAiBzB,SAAS,MAAA,CAAO,IAAA,EAAkB;AAChC,EAAA,IAAI,KAAA,EAAO,IAAA,CAAK,CAAC,CAAA;AACjB,EAAA,IAAI,MAAA,EAAQ,IAAA,CAAK,CAAC,CAAA;AAClB,EAAA,IAAI,KAAA,EAAO,IAAA,CAAK,CAAC,CAAA;AACjB,EAAA,IAAI,MAAA,EAAQ,IAAA,CAAK,CAAC,CAAA;AAElB,EAAA,IAAI,mBAAA,EAAqB,gCAAA,IAAS,CAAK,KAAA,CAAM,CAAA,EAAG,CAAC,CAAA,EAAG,CAAC,IAAA,EAAM,KAAK,CAAC,CAAA;AACjE,EAAA,IAAI,iBAAA,EAAmB,gCAAA,IAAS,CAAK,KAAA,CAAM,CAAA,EAAG,CAAC,CAAA,EAAG,CAAC,IAAA,EAAM,KAAK,CAAC,CAAA;AAC/D,EAAA,GAAA,CAAI,mBAAA,GAAsB,gBAAA,EAAkB;AAC1C,IAAA,IAAI,iBAAA,EAAA,CAAoB,MAAA,EAAQ,KAAA,EAAA,EAAS,CAAA;AACzC,IAAA,OAAO;AAAA,MACL,IAAA;AAAA,MACA,iBAAA,EAAA,CAAoB,KAAA,EAAO,IAAA,EAAA,EAAQ,CAAA;AAAA,MACnC,IAAA;AAAA,MACA,iBAAA,EAAA,CAAoB,KAAA,EAAO,IAAA,EAAA,EAAQ;AAAA,IACrC,CAAA;AAAA,EACF,EAAA,KAAO;AACL,IAAA,IAAI,mBAAA,EAAA,CAAsB,KAAA,EAAO,IAAA,EAAA,EAAQ,CAAA;AACzC,IAAA,OAAO;AAAA,MACL,mBAAA,EAAA,CAAsB,MAAA,EAAQ,KAAA,EAAA,EAAS,CAAA;AAAA,MACvC,KAAA;AAAA,MACA,mBAAA,EAAA,CAAsB,MAAA,EAAQ,KAAA,EAAA,EAAS,CAAA;AAAA,MACvC;AAAA,IACF,CAAA;AAAA,EACF;AACF;AAGA,IAAO,oBAAA,EAAQ,MAAA;ADjBf;AACE;AACA;AACF,+DAAC","file":"/home/runner/work/turf/turf/packages/turf-square/dist/cjs/index.cjs","sourcesContent":[null,"import { distance } from \"@turf/distance\";\nimport { BBox } from \"geojson\";\n\n/**\n * Takes a bounding box and calculates the minimum square bounding box that\n * would contain the input.\n *\n * @function\n * @param {BBox} bbox extent in [west, south, east, north] order\n * @returns {BBox} a square surrounding `bbox`\n * @example\n * const bbox = [-20, -20, -15, 0];\n * const squared = turf.square(bbox);\n *\n * //addToMap\n * const addToMap = [turf.bboxPolygon(bbox), turf.bboxPolygon(squared)]\n */\nfunction square(bbox: BBox): BBox {\n var west = bbox[0];\n var south = bbox[1];\n var east = bbox[2];\n var north = bbox[3];\n\n var horizontalDistance = distance(bbox.slice(0, 2), [east, south]);\n var verticalDistance = distance(bbox.slice(0, 2), [west, north]);\n if (horizontalDistance >= verticalDistance) {\n var verticalMidpoint = (south + north) / 2;\n return [\n west,\n verticalMidpoint - (east - west) / 2,\n east,\n verticalMidpoint + (east - west) / 2,\n ];\n } else {\n var horizontalMidpoint = (west + east) / 2;\n return [\n horizontalMidpoint - (north - south) / 2,\n south,\n horizontalMidpoint + (north - south) / 2,\n north,\n ];\n }\n}\n\nexport { square };\nexport default square;\n"]}
|
package/dist/cjs/index.d.cts
CHANGED
|
@@ -4,7 +4,7 @@ import { BBox } from 'geojson';
|
|
|
4
4
|
* Takes a bounding box and calculates the minimum square bounding box that
|
|
5
5
|
* would contain the input.
|
|
6
6
|
*
|
|
7
|
-
* @
|
|
7
|
+
* @function
|
|
8
8
|
* @param {BBox} bbox extent in [west, south, east, north] order
|
|
9
9
|
* @returns {BBox} a square surrounding `bbox`
|
|
10
10
|
* @example
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { BBox } from 'geojson';
|
|
|
4
4
|
* Takes a bounding box and calculates the minimum square bounding box that
|
|
5
5
|
* would contain the input.
|
|
6
6
|
*
|
|
7
|
-
* @
|
|
7
|
+
* @function
|
|
8
8
|
* @param {BBox} bbox extent in [west, south, east, north] order
|
|
9
9
|
* @returns {BBox} a square surrounding `bbox`
|
|
10
10
|
* @example
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../index.ts"],"sourcesContent":["import { distance } from \"@turf/distance\";\nimport { BBox } from \"geojson\";\n\n/**\n * Takes a bounding box and calculates the minimum square bounding box that\n * would contain the input.\n *\n * @
|
|
1
|
+
{"version":3,"sources":["../../index.ts"],"sourcesContent":["import { distance } from \"@turf/distance\";\nimport { BBox } from \"geojson\";\n\n/**\n * Takes a bounding box and calculates the minimum square bounding box that\n * would contain the input.\n *\n * @function\n * @param {BBox} bbox extent in [west, south, east, north] order\n * @returns {BBox} a square surrounding `bbox`\n * @example\n * const bbox = [-20, -20, -15, 0];\n * const squared = turf.square(bbox);\n *\n * //addToMap\n * const addToMap = [turf.bboxPolygon(bbox), turf.bboxPolygon(squared)]\n */\nfunction square(bbox: BBox): BBox {\n var west = bbox[0];\n var south = bbox[1];\n var east = bbox[2];\n var north = bbox[3];\n\n var horizontalDistance = distance(bbox.slice(0, 2), [east, south]);\n var verticalDistance = distance(bbox.slice(0, 2), [west, north]);\n if (horizontalDistance >= verticalDistance) {\n var verticalMidpoint = (south + north) / 2;\n return [\n west,\n verticalMidpoint - (east - west) / 2,\n east,\n verticalMidpoint + (east - west) / 2,\n ];\n } else {\n var horizontalMidpoint = (west + east) / 2;\n return [\n horizontalMidpoint - (north - south) / 2,\n south,\n horizontalMidpoint + (north - south) / 2,\n north,\n ];\n }\n}\n\nexport { square };\nexport default square;\n"],"mappings":";AAAA,SAAS,gBAAgB;AAiBzB,SAAS,OAAO,MAAkB;AAChC,MAAI,OAAO,KAAK,CAAC;AACjB,MAAI,QAAQ,KAAK,CAAC;AAClB,MAAI,OAAO,KAAK,CAAC;AACjB,MAAI,QAAQ,KAAK,CAAC;AAElB,MAAI,qBAAqB,SAAS,KAAK,MAAM,GAAG,CAAC,GAAG,CAAC,MAAM,KAAK,CAAC;AACjE,MAAI,mBAAmB,SAAS,KAAK,MAAM,GAAG,CAAC,GAAG,CAAC,MAAM,KAAK,CAAC;AAC/D,MAAI,sBAAsB,kBAAkB;AAC1C,QAAI,oBAAoB,QAAQ,SAAS;AACzC,WAAO;AAAA,MACL;AAAA,MACA,oBAAoB,OAAO,QAAQ;AAAA,MACnC;AAAA,MACA,oBAAoB,OAAO,QAAQ;AAAA,IACrC;AAAA,EACF,OAAO;AACL,QAAI,sBAAsB,OAAO,QAAQ;AACzC,WAAO;AAAA,MACL,sBAAsB,QAAQ,SAAS;AAAA,MACvC;AAAA,MACA,sBAAsB,QAAQ,SAAS;AAAA,MACvC;AAAA,IACF;AAAA,EACF;AACF;AAGA,IAAO,sBAAQ;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@turf/square",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.2.0",
|
|
4
4
|
"description": "turf square module",
|
|
5
5
|
"author": "Turf Authors",
|
|
6
6
|
"license": "MIT",
|
|
@@ -52,19 +52,19 @@
|
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@types/benchmark": "^2.1.5",
|
|
55
|
-
"@types/tape": "^4.
|
|
55
|
+
"@types/tape": "^4.13.4",
|
|
56
56
|
"benchmark": "^2.1.4",
|
|
57
57
|
"npm-run-all": "^4.1.5",
|
|
58
|
-
"tape": "^5.
|
|
59
|
-
"tsup": "^8.
|
|
60
|
-
"tsx": "^4.
|
|
61
|
-
"typescript": "^5.
|
|
58
|
+
"tape": "^5.9.0",
|
|
59
|
+
"tsup": "^8.3.5",
|
|
60
|
+
"tsx": "^4.19.2",
|
|
61
|
+
"typescript": "^5.5.4"
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@turf/distance": "^7.
|
|
65
|
-
"@turf/helpers": "^7.
|
|
64
|
+
"@turf/distance": "^7.2.0",
|
|
65
|
+
"@turf/helpers": "^7.2.0",
|
|
66
66
|
"@types/geojson": "^7946.0.10",
|
|
67
|
-
"tslib": "^2.
|
|
67
|
+
"tslib": "^2.8.1"
|
|
68
68
|
},
|
|
69
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "7b0f0374c4668cd569f8904c71e2ae7d941be867"
|
|
70
70
|
}
|