@digitraffic/common 2024.6.14-2 → 2024.6.26-1

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.
@@ -87,8 +87,8 @@ function distanceBetweenWGS84PointsInKm(fromXLon, fromYLat, toXLon, toYLat) {
87
87
  * @param pos2
88
88
  */
89
89
  export function distanceBetweenPositionsInKm(pos1, pos2) {
90
- if (pos1.length !== 2 && pos2.length !== 2) {
91
- throw Error(`Positions ${pos1.toString()} and ${pos2.toString()} both must be arrays of length two`);
90
+ if (pos1.length < 2 || pos1.length > 3 || pos2.length < 2 || pos2.length > 3) {
91
+ throw Error(`Illegal Positions ${pos1.toString()} and ${pos2.toString()}. Both must have length between 2 or 3.`);
92
92
  }
93
93
  return distanceBetweenWGS84PointsInKm(pos1[0], pos1[1], pos2[0], pos2[1]);
94
94
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digitraffic/common",
3
- "version": "2024.6.14-2",
3
+ "version": "2024.6.26-1",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "repository": {
@@ -137,7 +137,7 @@
137
137
  "@smithy/types": "2.12.0",
138
138
  "@types/aws-lambda": "8.10.136",
139
139
  "@types/etag": "1.8.3",
140
- "@types/geojson": "^7946.0.14",
140
+ "@types/geojson": "7946.0.14",
141
141
  "@types/geojson-validation": "^1.0.3",
142
142
  "@types/jest": "29.5.12",
143
143
  "@types/lodash": "4.14.202",