@ulrik.ek/wgs84 1.0.2 → 1.0.4
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/README.md +11 -9
- package/dist/index.d.ts +15 -15
- package/dist/index.js +138 -141
- package/dist/index.js.map +1 -1
- package/package.json +61 -61
package/README.md
CHANGED
|
@@ -26,24 +26,26 @@ const lat = 15;
|
|
|
26
26
|
const lon = 25;
|
|
27
27
|
const p: wgs84.Point = wgs84.point(lat, lon);
|
|
28
28
|
|
|
29
|
-
// Getting a new point
|
|
30
|
-
const p1: wgs84.Point = wgs84.pointEastOf(wgs84.pointNorthOf(p,
|
|
29
|
+
// Getting a new point 300m north and 400m east of the first point
|
|
30
|
+
const p1: wgs84.Point = wgs84.pointEastOf(wgs84.pointNorthOf(p, 300), 400);
|
|
31
31
|
const newLat = p1.coordinates[1]; // GeoJSON uses [lon, lat] order!
|
|
32
32
|
const newLon = p1.coordinates[0];
|
|
33
33
|
console.log(`lat=${newLat}, lon=${newLon}`);
|
|
34
34
|
|
|
35
35
|
// get the distance along north between the 2 points
|
|
36
|
-
console.log(`
|
|
37
|
-
console.log(`
|
|
36
|
+
console.log(`Distance along north=${wgs84.distanceNorth(p, p1)}`);
|
|
37
|
+
console.log(`Distance along east=${wgs84.distanceEast(p, p1)}`);
|
|
38
|
+
console.log(`Total distance=${wgs84.distance(p, p1)}`);
|
|
38
39
|
```
|
|
39
40
|
|
|
40
41
|
This will produce the following output
|
|
41
42
|
|
|
42
|
-
> lat=15.
|
|
43
|
-
>
|
|
44
|
-
>
|
|
43
|
+
> lat=15.002711283642645, lon=25.003719230339353
|
|
44
|
+
> Distance along north=300.00000000009265
|
|
45
|
+
> Distance along east=400.00504064747975
|
|
46
|
+
> Total distance=500.0040325271862
|
|
45
47
|
|
|
46
|
-
##
|
|
48
|
+
## Documentation
|
|
47
49
|
|
|
48
50
|
The following functions are available:
|
|
49
51
|
|
|
@@ -61,7 +63,7 @@ pointEastOf(origin: Point, dE: number): Point;
|
|
|
61
63
|
pointAbove(origin: Point, dH: number): Point;
|
|
62
64
|
```
|
|
63
65
|
|
|
64
|
-
[Full Typedoc documentation](https://github.com/UEk/wgs84/blob/main/doc/
|
|
66
|
+
[Full Typedoc documentation](https://github.com/UEk/wgs84/blob/main/doc/globals.md)
|
|
65
67
|
|
|
66
68
|
# Build and Test
|
|
67
69
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
export interface Point {
|
|
2
|
-
type: 'Point';
|
|
3
|
-
coordinates: number[];
|
|
4
|
-
}
|
|
5
|
-
export declare function point(lat: number, lon: number, height?: number): Point;
|
|
6
|
-
export declare function R1(position: Point): number;
|
|
7
|
-
export declare function R2(position: Point): number;
|
|
8
|
-
export declare function distanceNorth(origin: Point, target: Point): number;
|
|
9
|
-
export declare function distanceEast(origin: Point, target: Point): number;
|
|
10
|
-
export declare function distanceUp(origin: Point, target: Point): number;
|
|
11
|
-
export declare function distance(origin: Point, target: Point): number;
|
|
12
|
-
export declare function bearing(origin: Point, target: Point): number;
|
|
13
|
-
export declare function pointNorthOf(origin: Point, dN: number): Point;
|
|
14
|
-
export declare function pointEastOf(origin: Point, dE: number): Point;
|
|
15
|
-
export declare function pointAbove(origin: Point, dH: number): Point;
|
|
1
|
+
export interface Point {
|
|
2
|
+
type: 'Point';
|
|
3
|
+
coordinates: number[];
|
|
4
|
+
}
|
|
5
|
+
export declare function point(lat: number, lon: number, height?: number): Point;
|
|
6
|
+
export declare function R1(position: Point): number;
|
|
7
|
+
export declare function R2(position: Point): number;
|
|
8
|
+
export declare function distanceNorth(origin: Point, target: Point): number;
|
|
9
|
+
export declare function distanceEast(origin: Point, target: Point): number;
|
|
10
|
+
export declare function distanceUp(origin: Point, target: Point): number;
|
|
11
|
+
export declare function distance(origin: Point, target: Point): number;
|
|
12
|
+
export declare function bearing(origin: Point, target: Point): number;
|
|
13
|
+
export declare function pointNorthOf(origin: Point, dN: number): Point;
|
|
14
|
+
export declare function pointEastOf(origin: Point, dE: number): Point;
|
|
15
|
+
export declare function pointAbove(origin: Point, dH: number): Point;
|
package/dist/index.js
CHANGED
|
@@ -1,142 +1,139 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
exports.
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const
|
|
32
|
-
return
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
validCoord(
|
|
37
|
-
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
validCoord(
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
function pointNorthOf(origin, dN) {
|
|
82
|
-
validCoord(origin);
|
|
83
|
-
const lon = origin.coordinates[0];
|
|
84
|
-
const lat = radToDeg(degToRad(origin.coordinates[1]) + dN / R1(origin));
|
|
85
|
-
let result;
|
|
86
|
-
if (origin.coordinates[2]) {
|
|
87
|
-
const h = origin.coordinates[2];
|
|
88
|
-
result = { coordinates: [lon, lat, h], type: 'Point' };
|
|
89
|
-
}
|
|
90
|
-
else {
|
|
91
|
-
result = { coordinates: [lon, lat], type: 'Point' };
|
|
92
|
-
}
|
|
93
|
-
validCoord(result);
|
|
94
|
-
return result;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
function
|
|
125
|
-
return (
|
|
126
|
-
}
|
|
127
|
-
function
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
throw new Error(`Invalid GeoJson or lat/lon out of range`);
|
|
140
|
-
}
|
|
141
|
-
}
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.point = point;
|
|
4
|
+
exports.R1 = R1;
|
|
5
|
+
exports.R2 = R2;
|
|
6
|
+
exports.distanceNorth = distanceNorth;
|
|
7
|
+
exports.distanceEast = distanceEast;
|
|
8
|
+
exports.distanceUp = distanceUp;
|
|
9
|
+
exports.distance = distance;
|
|
10
|
+
exports.bearing = bearing;
|
|
11
|
+
exports.pointNorthOf = pointNorthOf;
|
|
12
|
+
exports.pointEastOf = pointEastOf;
|
|
13
|
+
exports.pointAbove = pointAbove;
|
|
14
|
+
function point(lat, lon, height) {
|
|
15
|
+
const result = height
|
|
16
|
+
? { coordinates: [lon, lat, height], type: 'Point' }
|
|
17
|
+
: { coordinates: [lon, lat], type: 'Point' };
|
|
18
|
+
validCoord(result);
|
|
19
|
+
return result;
|
|
20
|
+
}
|
|
21
|
+
const R = 6378.137 * 1000;
|
|
22
|
+
const f = 1 / 298.257_223_563;
|
|
23
|
+
const eSquared = f * (2 - f);
|
|
24
|
+
function R1(position) {
|
|
25
|
+
validCoord(position);
|
|
26
|
+
const lat = degToRad(position.coordinates[1]);
|
|
27
|
+
return (R * (1 - eSquared)) / Math.pow(1 - eSquared * Math.pow(Math.sin(lat), 2), 3 / 2);
|
|
28
|
+
}
|
|
29
|
+
function R2(position) {
|
|
30
|
+
validCoord(position);
|
|
31
|
+
const lat = degToRad(position.coordinates[1]);
|
|
32
|
+
return R / Math.sqrt(1 - eSquared * Math.pow(Math.sin(lat), 2));
|
|
33
|
+
}
|
|
34
|
+
function distanceNorth(origin, target) {
|
|
35
|
+
validCoord(origin);
|
|
36
|
+
validCoord(target);
|
|
37
|
+
const originLat = degToRad(origin.coordinates[1]);
|
|
38
|
+
const targetLat = degToRad(target.coordinates[1]);
|
|
39
|
+
return R1(origin) * (targetLat - originLat);
|
|
40
|
+
}
|
|
41
|
+
function distanceEast(origin, target) {
|
|
42
|
+
validCoord(origin);
|
|
43
|
+
validCoord(target);
|
|
44
|
+
const originLat = degToRad(origin.coordinates[1]);
|
|
45
|
+
const originLon = degToRad(origin.coordinates[0]);
|
|
46
|
+
const targetLon = degToRad(target.coordinates[0]);
|
|
47
|
+
let deltaAngle = targetLon - originLon;
|
|
48
|
+
if (deltaAngle > Math.PI) {
|
|
49
|
+
deltaAngle -= 2 * Math.PI;
|
|
50
|
+
}
|
|
51
|
+
else if (targetLon - originLon < -Math.PI) {
|
|
52
|
+
deltaAngle += 2 * Math.PI;
|
|
53
|
+
}
|
|
54
|
+
return R2(origin) * Math.cos(originLat) * deltaAngle;
|
|
55
|
+
}
|
|
56
|
+
function distanceUp(origin, target) {
|
|
57
|
+
if (origin.coordinates.length === 3 && target.coordinates.length === 3) {
|
|
58
|
+
return target.coordinates[2] - origin.coordinates[2];
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
throw new Error('Input is not GeoJSON Point with height.');
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
function distance(origin, target) {
|
|
65
|
+
if (origin.coordinates.length === 2 || target.coordinates.length === 2) {
|
|
66
|
+
return Math.hypot(distanceNorth(origin, target), distanceEast(origin, target));
|
|
67
|
+
}
|
|
68
|
+
else if (origin.coordinates.length === 3 && target.coordinates.length === 3) {
|
|
69
|
+
return Math.hypot(distanceNorth(origin, target), distanceEast(origin, target), distanceUp(origin, target));
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
throw new Error('Inputs are not GeoJSON Points.');
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
function bearing(origin, target) {
|
|
76
|
+
validCoord(origin);
|
|
77
|
+
validCoord(target);
|
|
78
|
+
return ((radToDeg(Math.atan2(distanceEast(origin, target), distanceNorth(origin, target))) + 360) %
|
|
79
|
+
360);
|
|
80
|
+
}
|
|
81
|
+
function pointNorthOf(origin, dN) {
|
|
82
|
+
validCoord(origin);
|
|
83
|
+
const lon = origin.coordinates[0];
|
|
84
|
+
const lat = radToDeg(degToRad(origin.coordinates[1]) + dN / R1(origin));
|
|
85
|
+
let result;
|
|
86
|
+
if (origin.coordinates[2]) {
|
|
87
|
+
const h = origin.coordinates[2];
|
|
88
|
+
result = { coordinates: [lon, lat, h], type: 'Point' };
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
result = { coordinates: [lon, lat], type: 'Point' };
|
|
92
|
+
}
|
|
93
|
+
validCoord(result);
|
|
94
|
+
return result;
|
|
95
|
+
}
|
|
96
|
+
function pointEastOf(origin, dE) {
|
|
97
|
+
validCoord(origin);
|
|
98
|
+
const lat = origin.coordinates[1];
|
|
99
|
+
let lon = radToDeg(degToRad(origin.coordinates[0]) + dE / (R2(origin) * Math.cos(degToRad(lat))));
|
|
100
|
+
if (lon > 180) {
|
|
101
|
+
lon -= 360;
|
|
102
|
+
}
|
|
103
|
+
else if (lon < -180) {
|
|
104
|
+
lon += 360;
|
|
105
|
+
}
|
|
106
|
+
if (origin.coordinates[2]) {
|
|
107
|
+
const h = origin.coordinates[2];
|
|
108
|
+
return { coordinates: [lon, lat, h], type: 'Point' };
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
return { coordinates: [lon, lat], type: 'Point' };
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
function pointAbove(origin, dH) {
|
|
115
|
+
validCoord(origin);
|
|
116
|
+
return {
|
|
117
|
+
coordinates: [origin.coordinates[0], origin.coordinates[1], origin.coordinates[2] + dH],
|
|
118
|
+
type: 'Point'
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
function degToRad(deg) {
|
|
122
|
+
return (deg * Math.PI) / 180;
|
|
123
|
+
}
|
|
124
|
+
function radToDeg(rad) {
|
|
125
|
+
return (rad * 180) / Math.PI;
|
|
126
|
+
}
|
|
127
|
+
function validCoord(p) {
|
|
128
|
+
if ((p.coordinates.length === 2 || p.coordinates.length === 3) &&
|
|
129
|
+
-90 <= p.coordinates[1] &&
|
|
130
|
+
p.coordinates[1] < 90 &&
|
|
131
|
+
-180 <= p.coordinates[0] &&
|
|
132
|
+
p.coordinates[0] <= 180) {
|
|
133
|
+
return true;
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
throw new Error(`Invalid GeoJson or lat/lon out of range`);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
142
139
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","source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,CAAC,GAAW;IACzB,OAAO,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC;AACjC,CAAC;AAED,SAAS,UAAU,CAAC,CAAQ;IACxB,IACI,CAAC,CAAC,CAAC,WAAW,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC,MAAM,KAAK,CAAC,CAAC;QAC1D,CAAC,EAAE,IAAI,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC;QACvB,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,EAAE;QACrB,CAAC,GAAG,IAAI,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC;QACxB,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,GAAG,EACzB,CAAC;QACC,OAAO,IAAI,CAAC;IAChB,CAAC;SAAM,CAAC;QACJ,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;IAC/D,CAAC;AACL,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,61 +1,61 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@ulrik.ek/wgs84",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "Basic library for computing small distances between WGS84 coordinates using a flat earth approximation.",
|
|
5
|
-
"author": "Ulrik E.",
|
|
6
|
-
"license": "MIT",
|
|
7
|
-
"main": "dist/index.js",
|
|
8
|
-
"directories": {
|
|
9
|
-
"doc": "doc",
|
|
10
|
-
"test": "test"
|
|
11
|
-
},
|
|
12
|
-
"type": "commonjs",
|
|
13
|
-
"scripts": {
|
|
14
|
-
"audit": "npm audit --registry=https://registry.npmjs.org",
|
|
15
|
-
"lint": "npx eslint .",
|
|
16
|
-
"lint_fix": "npx eslint . --fix",
|
|
17
|
-
"style": "npx prettier --check \"./**/*.ts\" --check \"./**/*.json\" --check \"./**/*.md\"",
|
|
18
|
-
"style_fix": "npx prettier --write \"./**/*.ts\" --write \"./**/*.json\" --write \"./**/*.md\"",
|
|
19
|
-
"verify_and_install": "npm cache verify && npm install",
|
|
20
|
-
"clean": "npx shx rm -rf ./coverage/ ./report/ ./dist/",
|
|
21
|
-
"build": "tsc --build tsconfig.json",
|
|
22
|
-
"test": "npm run clean && npx jest --clearCache && jest --verbose --coverage --color --modulePathIgnorePatterns=./dist/ && npm run build",
|
|
23
|
-
"run_example": "npx ts-node example/index.ts",
|
|
24
|
-
"type_doc": "npx typedoc --plugin typedoc-plugin-markdown --out doc src/index.ts --excludeNotDocumented"
|
|
25
|
-
},
|
|
26
|
-
"devDependencies": {
|
|
27
|
-
"@types/geojson": "^7946.0.
|
|
28
|
-
"@types/jest": "^
|
|
29
|
-
"@types/node": "^
|
|
30
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
31
|
-
"@typescript-eslint/parser": "^5.
|
|
32
|
-
"eslint": "^8.
|
|
33
|
-
"eslint-plugin-import": "^2.
|
|
34
|
-
"eslint-plugin-jest": "
|
|
35
|
-
"eslint-plugin-json": "^3.1.0",
|
|
36
|
-
"eslint-plugin-simple-import-sort": "^
|
|
37
|
-
"eslint-plugin-sort-class-members": "^1.
|
|
38
|
-
"eslint-plugin-sort-keys-fix": "^1.1.2",
|
|
39
|
-
"eslint-plugin-unicorn": "^
|
|
40
|
-
"eslint-plugin-yaml": "^0.5.0",
|
|
41
|
-
"jest": "^
|
|
42
|
-
"jest-junit": "^
|
|
43
|
-
"prettier": "
|
|
44
|
-
"shx": "^0.3.4",
|
|
45
|
-
"ts-jest": "^
|
|
46
|
-
"ts-node": "^10.
|
|
47
|
-
"typedoc": "^0.
|
|
48
|
-
"typedoc-plugin-markdown": "^
|
|
49
|
-
"typescript": "^
|
|
50
|
-
},
|
|
51
|
-
"types": "./dist/index.d.ts",
|
|
52
|
-
"repository": {
|
|
53
|
-
"type": "git",
|
|
54
|
-
"url": "git+https://github.com/UEk/wgs84.git"
|
|
55
|
-
},
|
|
56
|
-
"bugs": {
|
|
57
|
-
"url": "https://github.com/UEk/wgs84/issues"
|
|
58
|
-
},
|
|
59
|
-
"homepage": "https://github.com/UEk/wgs84#readme",
|
|
60
|
-
"keywords": ["wgs84", "geojson", "latitude", "longitude"]
|
|
61
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@ulrik.ek/wgs84",
|
|
3
|
+
"version": "1.0.4",
|
|
4
|
+
"description": "Basic library for computing small distances between WGS84 coordinates using a flat earth approximation.",
|
|
5
|
+
"author": "Ulrik E.",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"main": "dist/index.js",
|
|
8
|
+
"directories": {
|
|
9
|
+
"doc": "doc",
|
|
10
|
+
"test": "test"
|
|
11
|
+
},
|
|
12
|
+
"type": "commonjs",
|
|
13
|
+
"scripts": {
|
|
14
|
+
"audit": "npm audit --registry=https://registry.npmjs.org",
|
|
15
|
+
"lint": "npx eslint .",
|
|
16
|
+
"lint_fix": "npx eslint . --fix",
|
|
17
|
+
"style": "npx prettier --check \"./**/*.ts\" --check \"./**/*.json\" --check \"./**/*.md\"",
|
|
18
|
+
"style_fix": "npx prettier --write \"./**/*.ts\" --write \"./**/*.json\" --write \"./**/*.md\"",
|
|
19
|
+
"verify_and_install": "npm cache verify && npm install",
|
|
20
|
+
"clean": "npx shx rm -rf ./coverage/ ./report/ ./dist/",
|
|
21
|
+
"build": "tsc --build tsconfig.json",
|
|
22
|
+
"test": "npm run clean && npx jest --clearCache && jest --verbose --coverage --color --modulePathIgnorePatterns=./dist/ && npm run build",
|
|
23
|
+
"run_example": "npx ts-node example/index.ts",
|
|
24
|
+
"type_doc": "npx typedoc --plugin typedoc-plugin-markdown --out doc src/index.ts --excludeNotDocumented"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@types/geojson": "^7946.0.14",
|
|
28
|
+
"@types/jest": "^29.5.12",
|
|
29
|
+
"@types/node": "^22.1.0",
|
|
30
|
+
"@typescript-eslint/eslint-plugin": "^7.5.0",
|
|
31
|
+
"@typescript-eslint/parser": "^7.5.0",
|
|
32
|
+
"eslint": "^8.57.0",
|
|
33
|
+
"eslint-plugin-import": "^2.29.1",
|
|
34
|
+
"eslint-plugin-jest": "^27.9.0",
|
|
35
|
+
"eslint-plugin-json": "^3.1.0",
|
|
36
|
+
"eslint-plugin-simple-import-sort": "^12.0.0",
|
|
37
|
+
"eslint-plugin-sort-class-members": "^1.20.0",
|
|
38
|
+
"eslint-plugin-sort-keys-fix": "^1.1.2",
|
|
39
|
+
"eslint-plugin-unicorn": "^52.0.0",
|
|
40
|
+
"eslint-plugin-yaml": "^0.5.0",
|
|
41
|
+
"jest": "^29.7.0",
|
|
42
|
+
"jest-junit": "^16.0.0",
|
|
43
|
+
"prettier": "3.3.0",
|
|
44
|
+
"shx": "^0.3.4",
|
|
45
|
+
"ts-jest": "^29.1.2",
|
|
46
|
+
"ts-node": "^10.9.2",
|
|
47
|
+
"typedoc": "^0.26.5",
|
|
48
|
+
"typedoc-plugin-markdown": "^4.2.3",
|
|
49
|
+
"typescript": "^5.5.4"
|
|
50
|
+
},
|
|
51
|
+
"types": "./dist/index.d.ts",
|
|
52
|
+
"repository": {
|
|
53
|
+
"type": "git",
|
|
54
|
+
"url": "git+https://github.com/UEk/wgs84.git"
|
|
55
|
+
},
|
|
56
|
+
"bugs": {
|
|
57
|
+
"url": "https://github.com/UEk/wgs84/issues"
|
|
58
|
+
},
|
|
59
|
+
"homepage": "https://github.com/UEk/wgs84#readme",
|
|
60
|
+
"keywords": ["wgs84", "geojson", "latitude", "longitude"]
|
|
61
|
+
}
|