@digitraffic/common 2024.6.14-2 → 2024.6.26-2

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.
@@ -1,4 +1,3 @@
1
- /// <reference types="node" resolution-mode="require"/>
2
1
  import { IncomingMessage } from "http";
3
2
  import { MediaType } from "../../types/mediatypes.mjs";
4
3
  import type { FeatureCollection } from "geojson";
@@ -1,4 +1,3 @@
1
- /// <reference types="node" resolution-mode="require"/>
2
1
  import { Writable } from "stream";
3
2
  /** Logging level */
4
3
  export type LOG_LEVEL = "DEBUG" | "INFO" | "WARN" | "ERROR";
@@ -1,4 +1,3 @@
1
- /// <reference types="node" resolution-mode="require"/>
2
1
  /**
3
2
  * Decode given string from base64 to ascii
4
3
  * @param str string
@@ -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-2",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "repository": {
@@ -103,71 +103,72 @@
103
103
  "./dist/aws/runtime/digitraffic-integration-response": "./dist/aws/runtime/digitraffic-integration-response.mjs"
104
104
  },
105
105
  "peerDependencies": {
106
- "@aws-sdk/client-api-gateway": "^3.540.0",
107
- "@aws-sdk/client-s3": "^3.540.0",
108
- "@aws-sdk/client-secrets-manager": "^3.540.0",
109
- "@aws-sdk/client-sns": "^3.540.0",
110
- "@aws-sdk/lib-storage": "^3.540.0",
111
- "@types/geojson": "^7946.0.14",
112
- "aws-cdk-lib": "^2.134.0",
113
- "change-case": "5.0.0",
106
+ "@aws-sdk/client-api-gateway": "^3.600.0",
107
+ "@aws-sdk/client-s3": "^3.600.0",
108
+ "@aws-sdk/client-secrets-manager": "^3.600.0",
109
+ "@aws-sdk/client-sns": "^3.600.0",
110
+ "@aws-sdk/lib-storage": "^3.600.0",
111
+ "aws-sdk": "^2.1648.0",
112
+ "aws-cdk-lib": "^2.147.1",
113
+ "change-case": "^5.4.4",
114
114
  "constructs": "^10.3.0",
115
- "date-fns": "~2.30.0",
116
- "date-fns-tz": "~2.0.0",
115
+ "date-fns": "^3.6.0",
116
+ "date-fns-tz": "^3.1.3",
117
117
  "etag": "^1.8.1",
118
118
  "geojson-validation": "^1.0.2",
119
- "ky": "^1.2.3",
120
- "lodash": "~4.17.21",
119
+ "ky": "^1.3.0",
120
+ "lodash": "^4.17.21",
121
121
  "node-ttl": "^0.2.0",
122
- "pg-native": "^3.0.1",
123
- "pg-promise": "^11.5.4"
122
+ "pg-native": "^3.1.0",
123
+ "pg-promise": "^11.8.0"
124
124
  },
125
125
  "devDependencies": {
126
- "@aws-sdk/client-api-gateway": "3.540.0",
127
- "@aws-sdk/client-s3": "3.540.0",
128
- "@aws-sdk/client-secrets-manager": "3.540.0",
129
- "@aws-sdk/client-sns": "3.540.0",
130
- "@aws-sdk/lib-storage": "3.540.0",
126
+ "@aws-sdk/client-api-gateway": "^3.600.0",
127
+ "@aws-sdk/client-s3": "^3.600.0",
128
+ "@aws-sdk/client-secrets-manager": "^3.600.0",
129
+ "@aws-sdk/client-sns": "^3.600.0",
130
+ "@aws-sdk/lib-storage": "^3.600.0",
131
+ "aws-cdk-lib": "^2.147.1",
132
+ "change-case": "^5.4.4",
133
+ "constructs": "^10.3.0",
134
+ "date-fns": "^3.6.0",
135
+ "date-fns-tz": "^3.1.3",
136
+ "etag": "^1.8.1",
137
+ "geojson-validation": "^1.0.2",
138
+ "ky": "^1.3.0",
139
+ "lodash": "^4.17.21",
140
+ "node-ttl": "^0.2.0",
141
+ "pg-native": "^3.1.0",
142
+ "pg-promise": "^11.8.0",
131
143
  "@jest/globals": "^29.7.0",
132
- "@rushstack/eslint-config": "^3.6.8",
133
- "@rushstack/heft": "^0.66.2",
134
- "@rushstack/heft-jest-plugin": "^0.11.23",
135
- "@rushstack/heft-lint-plugin": "^0.3.23",
136
- "@rushstack/heft-typescript-plugin": "^0.3.21",
137
- "@smithy/types": "2.12.0",
138
- "@types/aws-lambda": "8.10.136",
139
- "@types/etag": "1.8.3",
144
+ "@rushstack/eslint-config": "^3.7.0",
145
+ "@rushstack/heft": "^0.66.18",
146
+ "@rushstack/heft-jest-plugin": "^0.12.0",
147
+ "@rushstack/heft-lint-plugin": "^0.3.39",
148
+ "@rushstack/heft-typescript-plugin": "^0.5.16",
149
+ "@smithy/types": "^3.2.0",
150
+ "@types/aws-lambda": "^8.10.140",
151
+ "@types/etag": "^1.8.3",
140
152
  "@types/geojson": "^7946.0.14",
141
153
  "@types/geojson-validation": "^1.0.3",
142
- "@types/jest": "29.5.12",
143
- "@types/lodash": "4.14.202",
144
- "@types/madge": "5.0.3",
145
- "@types/node": "20.11.27",
146
- "@typescript-eslint/eslint-plugin": "~6.18.1",
147
- "@typescript-eslint/parser": "^6.21.0",
148
- "aws-cdk-lib": "^2.135.0",
149
- "aws-sdk": "2.1586.0",
150
- "change-case": "5.3.0",
151
- "constructs": "10.3.0",
152
- "date-fns": "~2.30.0",
153
- "date-fns-tz": "~2.0.1",
154
- "eslint": "~8.57.0",
154
+ "@types/jest": "^29.5.12",
155
+ "@types/lodash": "^4.17.5",
156
+ "@types/madge": "^5.0.3",
157
+ "@types/node": "^20.14.9",
158
+ "@typescript-eslint/eslint-plugin": "^7.14.1",
159
+ "@typescript-eslint/parser": "^7.14.1",
160
+ "aws-sdk": "^2.1648.0",
161
+ "eslint": "^8.57.0",
155
162
  "eslint-config-prettier": "^9.1.0",
156
- "eslint-plugin-deprecation": "~2.0.0",
157
- "etag": "^1.8.1",
158
- "geojson-validation": "^1.0.2",
163
+ "eslint-plugin-deprecation": "^3.0.0",
159
164
  "jest": "^29.7.0",
160
165
  "jest-junit": "^16.0.0",
161
- "ky": "^1.2.3",
162
- "lodash": "~4.17.21",
163
- "madge": "6.1.0",
164
- "node-ttl": "^0.2.0",
165
- "pg-promise": "^11.5.5",
166
- "prettier": "^3.2.5",
167
- "rimraf": "^5.0.5",
168
- "ts-jest": "^29.1.2",
169
- "typescript": "~5.3.3",
170
- "velocityjs": "2.0.6"
166
+ "madge": "^7.0.0",
167
+ "prettier": "^3.3.2",
168
+ "rimraf": "^5.0.7",
169
+ "ts-jest": "^29.1.5",
170
+ "typescript": "^5.5.2",
171
+ "velocityjs": "^2.0.6"
171
172
  },
172
173
  "scripts": {
173
174
  "build": "tsc",