@turf/midpoint 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 +12 -12
package/dist/cjs/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../index.ts"],"names":["midpoint"],"mappings":";
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/turf/turf/packages/turf-midpoint/dist/cjs/index.cjs","../../index.ts"],"names":["midpoint"],"mappings":"AAAA;ACCA,wCAAwB;AACxB,gDAA4B;AAC5B,0CAAyB;AAsBzB,SAAS,QAAA,CAAS,MAAA,EAAe,MAAA,EAA+B;AAC9D,EAAA,MAAM,KAAA,EAAO,gCAAA,MAAS,EAAQ,MAAM,CAAA;AACpC,EAAA,MAAM,QAAA,EAAU,8BAAA,MAAQ,EAAQ,MAAM,CAAA;AACtC,EAAA,MAAMA,UAAAA,EAAW,sCAAA,MAAY,EAAQ,KAAA,EAAO,CAAA,EAAG,OAAO,CAAA;AAEtD,EAAA,OAAOA,SAAAA;AACT;AAGA,IAAO,sBAAA,EAAQ,QAAA;ADvBf;AACE;AACA;AACF,qEAAC","file":"/home/runner/work/turf/turf/packages/turf-midpoint/dist/cjs/index.cjs","sourcesContent":[null,"import { Feature, Point } from \"geojson\";\nimport { bearing } from \"@turf/bearing\";\nimport { destination } from \"@turf/destination\";\nimport { distance } from \"@turf/distance\";\nimport { Coord } from \"@turf/helpers\";\n\n/**\n * Takes two points and returns a point midway between them. The midpoint is\n * calculated geodesically, meaning the curvature of the earth is taken into\n * account.\n *\n * @function\n * @param {Coord} point1 first point\n * @param {Coord} point2 second point\n * @returns {Feature<Point>} a point midway between `pt1` and `pt2`\n * @example\n * const point1 = turf.point([144.834823, -37.771257]);\n * const point2 = turf.point([145.14244, -37.830937]);\n *\n * const midpoint = turf.midpoint(point1, point2);\n *\n * //addToMap\n * const addToMap = [point1, point2, midpoint];\n * midpoint.properties['marker-color'] = '#f00';\n */\nfunction midpoint(point1: Coord, point2: Coord): Feature<Point> {\n const dist = distance(point1, point2);\n const heading = bearing(point1, point2);\n const midpoint = destination(point1, dist / 2, heading);\n\n return midpoint;\n}\n\nexport { midpoint };\nexport default midpoint;\n"]}
|
package/dist/cjs/index.d.cts
CHANGED
|
@@ -6,7 +6,7 @@ import { Coord } from '@turf/helpers';
|
|
|
6
6
|
* calculated geodesically, meaning the curvature of the earth is taken into
|
|
7
7
|
* account.
|
|
8
8
|
*
|
|
9
|
-
* @
|
|
9
|
+
* @function
|
|
10
10
|
* @param {Coord} point1 first point
|
|
11
11
|
* @param {Coord} point2 second point
|
|
12
12
|
* @returns {Feature<Point>} a point midway between `pt1` and `pt2`
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { Coord } from '@turf/helpers';
|
|
|
6
6
|
* calculated geodesically, meaning the curvature of the earth is taken into
|
|
7
7
|
* account.
|
|
8
8
|
*
|
|
9
|
-
* @
|
|
9
|
+
* @function
|
|
10
10
|
* @param {Coord} point1 first point
|
|
11
11
|
* @param {Coord} point2 second point
|
|
12
12
|
* @returns {Feature<Point>} a point midway between `pt1` and `pt2`
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../index.ts"],"sourcesContent":["import { Feature, Point } from \"geojson\";\nimport { bearing } from \"@turf/bearing\";\nimport { destination } from \"@turf/destination\";\nimport { distance } from \"@turf/distance\";\nimport { Coord } from \"@turf/helpers\";\n\n/**\n * Takes two points and returns a point midway between them. The midpoint is\n * calculated geodesically, meaning the curvature of the earth is taken into\n * account.\n *\n * @
|
|
1
|
+
{"version":3,"sources":["../../index.ts"],"sourcesContent":["import { Feature, Point } from \"geojson\";\nimport { bearing } from \"@turf/bearing\";\nimport { destination } from \"@turf/destination\";\nimport { distance } from \"@turf/distance\";\nimport { Coord } from \"@turf/helpers\";\n\n/**\n * Takes two points and returns a point midway between them. The midpoint is\n * calculated geodesically, meaning the curvature of the earth is taken into\n * account.\n *\n * @function\n * @param {Coord} point1 first point\n * @param {Coord} point2 second point\n * @returns {Feature<Point>} a point midway between `pt1` and `pt2`\n * @example\n * const point1 = turf.point([144.834823, -37.771257]);\n * const point2 = turf.point([145.14244, -37.830937]);\n *\n * const midpoint = turf.midpoint(point1, point2);\n *\n * //addToMap\n * const addToMap = [point1, point2, midpoint];\n * midpoint.properties['marker-color'] = '#f00';\n */\nfunction midpoint(point1: Coord, point2: Coord): Feature<Point> {\n const dist = distance(point1, point2);\n const heading = bearing(point1, point2);\n const midpoint = destination(point1, dist / 2, heading);\n\n return midpoint;\n}\n\nexport { midpoint };\nexport default midpoint;\n"],"mappings":";AACA,SAAS,eAAe;AACxB,SAAS,mBAAmB;AAC5B,SAAS,gBAAgB;AAsBzB,SAAS,SAAS,QAAe,QAA+B;AAC9D,QAAM,OAAO,SAAS,QAAQ,MAAM;AACpC,QAAM,UAAU,QAAQ,QAAQ,MAAM;AACtC,QAAMA,YAAW,YAAY,QAAQ,OAAO,GAAG,OAAO;AAEtD,SAAOA;AACT;AAGA,IAAO,wBAAQ;","names":["midpoint"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@turf/midpoint",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.2.0",
|
|
4
4
|
"description": "turf midpoint module",
|
|
5
5
|
"author": "Turf Authors",
|
|
6
6
|
"license": "MIT",
|
|
@@ -53,21 +53,21 @@
|
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@types/benchmark": "^2.1.5",
|
|
56
|
-
"@types/tape": "^4.
|
|
56
|
+
"@types/tape": "^4.13.4",
|
|
57
57
|
"benchmark": "^2.1.4",
|
|
58
58
|
"npm-run-all": "^4.1.5",
|
|
59
|
-
"tape": "^5.
|
|
60
|
-
"tsup": "^8.
|
|
61
|
-
"tsx": "^4.
|
|
62
|
-
"typescript": "^5.
|
|
59
|
+
"tape": "^5.9.0",
|
|
60
|
+
"tsup": "^8.3.5",
|
|
61
|
+
"tsx": "^4.19.2",
|
|
62
|
+
"typescript": "^5.5.4"
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@turf/bearing": "^7.
|
|
66
|
-
"@turf/destination": "^7.
|
|
67
|
-
"@turf/distance": "^7.
|
|
68
|
-
"@turf/helpers": "^7.
|
|
65
|
+
"@turf/bearing": "^7.2.0",
|
|
66
|
+
"@turf/destination": "^7.2.0",
|
|
67
|
+
"@turf/distance": "^7.2.0",
|
|
68
|
+
"@turf/helpers": "^7.2.0",
|
|
69
69
|
"@types/geojson": "^7946.0.10",
|
|
70
|
-
"tslib": "^2.
|
|
70
|
+
"tslib": "^2.8.1"
|
|
71
71
|
},
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "7b0f0374c4668cd569f8904c71e2ae7d941be867"
|
|
73
73
|
}
|