@nxtedition/lib 20.3.6 → 20.3.9
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/package.json +12 -12
- package/util/compare-rev.js +70 -50
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nxtedition/lib",
|
|
3
|
-
"version": "20.3.
|
|
3
|
+
"version": "20.3.9",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Robert Nagy <robert.nagy@boffins.se>",
|
|
6
6
|
"type": "module",
|
|
@@ -54,10 +54,10 @@
|
|
|
54
54
|
"singleQuote": true
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@aws-sdk/client-s3": "^3.
|
|
58
|
-
"@elastic/elasticsearch": "^8.
|
|
59
|
-
"@elastic/transport": "^8.7.
|
|
60
|
-
"@nxtedition/nxt-undici": "^4.2.
|
|
57
|
+
"@aws-sdk/client-s3": "^3.637.0",
|
|
58
|
+
"@elastic/elasticsearch": "^8.15.0",
|
|
59
|
+
"@elastic/transport": "^8.7.1",
|
|
60
|
+
"@nxtedition/nxt-undici": "^4.2.13",
|
|
61
61
|
"content-type": "^1.0.5",
|
|
62
62
|
"date-fns": "^3.6.0",
|
|
63
63
|
"fast-querystring": "^1.1.1",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"request-target": "^1.0.2",
|
|
79
79
|
"smpte-timecode": "^1.3.6",
|
|
80
80
|
"split-string": "^6.0.0",
|
|
81
|
-
"undici": "^6.19.
|
|
81
|
+
"undici": "^6.19.8",
|
|
82
82
|
"url-join": "^5.0.0",
|
|
83
83
|
"xuid": "^4.1.3",
|
|
84
84
|
"yocto-queue": "^1.1.1"
|
|
@@ -86,22 +86,22 @@
|
|
|
86
86
|
"devDependencies": {
|
|
87
87
|
"@nxtedition/deepstream.io-client-js": ">=25.6.3",
|
|
88
88
|
"@types/lodash": "^4.17.7",
|
|
89
|
-
"@types/node": "^22.2
|
|
90
|
-
"eslint": "^9.9.
|
|
89
|
+
"@types/node": "^22.5.2",
|
|
90
|
+
"eslint": "^9.9.1",
|
|
91
91
|
"eslint-config-prettier": "^9.1.0",
|
|
92
92
|
"eslint-config-standard": "^17.0.0",
|
|
93
93
|
"eslint-plugin-import": "^2.29.1",
|
|
94
94
|
"eslint-plugin-n": "^17.10.2",
|
|
95
95
|
"eslint-plugin-node": "^11.1.0",
|
|
96
96
|
"eslint-plugin-promise": "^7.1.0",
|
|
97
|
-
"husky": "^9.1.
|
|
98
|
-
"lint-staged": "^15.2.
|
|
97
|
+
"husky": "^9.1.5",
|
|
98
|
+
"lint-staged": "^15.2.10",
|
|
99
99
|
"pinst": "^3.0.0",
|
|
100
100
|
"prettier": "^3.3.3",
|
|
101
101
|
"rxjs": "^7.5.6",
|
|
102
102
|
"send": "^0.18.0",
|
|
103
|
-
"tap": "^21.0.
|
|
104
|
-
"typescript-eslint": "^8.0
|
|
103
|
+
"tap": "^21.0.1",
|
|
104
|
+
"typescript-eslint": "^8.3.0"
|
|
105
105
|
},
|
|
106
106
|
"peerDependencies": {
|
|
107
107
|
"@elastic/elasticsearch": "^8.6.0",
|
package/util/compare-rev.js
CHANGED
|
@@ -12,29 +12,29 @@ export function compareRevStringString(a, b) {
|
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
let indexA = 0
|
|
16
15
|
const endA = a.length
|
|
16
|
+
let idxA = 0
|
|
17
17
|
let lenA = endA
|
|
18
18
|
|
|
19
|
-
let indexB = 0
|
|
20
19
|
const endB = b.length
|
|
20
|
+
let idxB = 0
|
|
21
21
|
let lenB = endB
|
|
22
22
|
|
|
23
23
|
// Skip leading zeroes
|
|
24
|
-
while (a[
|
|
25
|
-
++
|
|
24
|
+
while (a[idxA] === '0') {
|
|
25
|
+
++idxA
|
|
26
26
|
--lenA
|
|
27
27
|
}
|
|
28
|
-
while (b[
|
|
29
|
-
++
|
|
28
|
+
while (b[idxB] === '0') {
|
|
29
|
+
++idxB
|
|
30
30
|
--lenB
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
// Compare the revision number
|
|
34
34
|
let result = 0
|
|
35
|
-
while (
|
|
36
|
-
const ac = a[
|
|
37
|
-
const bc = b[
|
|
35
|
+
while (idxA < endA && idxB < endB) {
|
|
36
|
+
const ac = a[idxA++]
|
|
37
|
+
const bc = b[idxB++]
|
|
38
38
|
|
|
39
39
|
if (ac === '-') {
|
|
40
40
|
if (bc === '-') {
|
|
@@ -53,9 +53,9 @@ export function compareRevStringString(a, b) {
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
// Compare the rest
|
|
56
|
-
while (
|
|
57
|
-
const ac = a[
|
|
58
|
-
const bc = b[
|
|
56
|
+
while (idxA < endA && idxB < endB) {
|
|
57
|
+
const ac = a[idxA++]
|
|
58
|
+
const bc = b[idxB++]
|
|
59
59
|
if (ac !== bc) {
|
|
60
60
|
return ac < bc ? -1 : 1
|
|
61
61
|
}
|
|
@@ -78,29 +78,29 @@ export function compareRevBufferBuffer(a, b) {
|
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
let indexA = 0
|
|
82
81
|
const endA = a.length
|
|
82
|
+
let idxA = 0
|
|
83
83
|
let lenA = endA
|
|
84
84
|
|
|
85
|
-
let indexB = 0
|
|
86
85
|
const endB = b.length
|
|
86
|
+
let idxB = 0
|
|
87
87
|
let lenB = endB
|
|
88
88
|
|
|
89
89
|
// Skip leading zeroes
|
|
90
|
-
while (a[
|
|
91
|
-
++
|
|
90
|
+
while (a[idxA] === ordZero) {
|
|
91
|
+
++idxA
|
|
92
92
|
--lenA
|
|
93
93
|
}
|
|
94
|
-
while (b[
|
|
95
|
-
++
|
|
94
|
+
while (b[idxB] === ordZero) {
|
|
95
|
+
++idxB
|
|
96
96
|
--lenB
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
// Compare the revision number
|
|
100
100
|
let result = 0
|
|
101
|
-
while (
|
|
102
|
-
const ac = a[
|
|
103
|
-
const bc = b[
|
|
101
|
+
while (idxA < endA && idxB < endB) {
|
|
102
|
+
const ac = a[idxA++]
|
|
103
|
+
const bc = b[idxB++]
|
|
104
104
|
|
|
105
105
|
const isDashA = ac === ordDash
|
|
106
106
|
const isDashB = bc === ordDash
|
|
@@ -121,9 +121,9 @@ export function compareRevBufferBuffer(a, b) {
|
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
// Compare the rest
|
|
124
|
-
while (
|
|
125
|
-
const ac = a[
|
|
126
|
-
const bc = b[
|
|
124
|
+
while (idxA < endA && idxB < endB) {
|
|
125
|
+
const ac = a[idxA++]
|
|
126
|
+
const bc = b[idxB++]
|
|
127
127
|
result = ac - bc
|
|
128
128
|
if (result) {
|
|
129
129
|
return result
|
|
@@ -143,29 +143,29 @@ export function compareRevBufferString(a, b) {
|
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
145
|
|
|
146
|
-
let
|
|
146
|
+
let idxA = 0
|
|
147
147
|
const endA = a.length
|
|
148
148
|
let lenA = endA
|
|
149
149
|
|
|
150
|
-
let
|
|
150
|
+
let idxB = 0
|
|
151
151
|
const endB = b.length
|
|
152
152
|
let lenB = endB
|
|
153
153
|
|
|
154
154
|
// Skip leading zeroes
|
|
155
|
-
while (a[
|
|
156
|
-
++
|
|
155
|
+
while (a[idxA] === ordZero) {
|
|
156
|
+
++idxA
|
|
157
157
|
--lenA
|
|
158
158
|
}
|
|
159
|
-
while (b[
|
|
160
|
-
++
|
|
159
|
+
while (b[idxB] === '0') {
|
|
160
|
+
++idxB
|
|
161
161
|
--lenB
|
|
162
162
|
}
|
|
163
163
|
|
|
164
164
|
// Compare the revision number
|
|
165
165
|
let result = 0
|
|
166
|
-
while (
|
|
167
|
-
const ac = String.fromCharCode(a[
|
|
168
|
-
const bc = b[
|
|
166
|
+
while (idxA < endA && idxB < endB) {
|
|
167
|
+
const ac = String.fromCharCode(a[idxA++])
|
|
168
|
+
const bc = b[idxB++]
|
|
169
169
|
|
|
170
170
|
const isDashA = ac === '-'
|
|
171
171
|
const isDashB = bc === '-'
|
|
@@ -186,9 +186,9 @@ export function compareRevBufferString(a, b) {
|
|
|
186
186
|
}
|
|
187
187
|
|
|
188
188
|
// Compare the rest
|
|
189
|
-
while (
|
|
190
|
-
const ac = String.fromCharCode(a[
|
|
191
|
-
const bc = b[
|
|
189
|
+
while (idxA < endA && idxB < endB) {
|
|
190
|
+
const ac = String.fromCharCode(a[idxA++])
|
|
191
|
+
const bc = b[idxB++]
|
|
192
192
|
if (ac !== bc) {
|
|
193
193
|
return ac < bc ? -1 : 1
|
|
194
194
|
}
|
|
@@ -209,40 +209,60 @@ export function compareRevSliceSlice(a, b) {
|
|
|
209
209
|
return 0
|
|
210
210
|
}
|
|
211
211
|
|
|
212
|
-
let indexA = a.byteOffset
|
|
213
212
|
const endA = a.byteOffset + a.byteLength
|
|
213
|
+
let idxA = a.byteOffset
|
|
214
214
|
let lenA = endA
|
|
215
215
|
a = a.buffer
|
|
216
216
|
|
|
217
|
-
|
|
217
|
+
if (
|
|
218
|
+
!Buffer.isBuffer(a) ||
|
|
219
|
+
!Number.isInteger(idxA) ||
|
|
220
|
+
idxA < 0 ||
|
|
221
|
+
!Number.isInteger(lenA) ||
|
|
222
|
+
lenA < 0
|
|
223
|
+
) {
|
|
224
|
+
throw new Error('invalid argument: a')
|
|
225
|
+
}
|
|
226
|
+
|
|
218
227
|
const endB = b.byteOffset + b.byteLength
|
|
228
|
+
let idxB = b.byteOffset
|
|
219
229
|
let lenB = endB
|
|
220
230
|
b = b.buffer
|
|
221
231
|
|
|
232
|
+
if (
|
|
233
|
+
!Buffer.isBuffer(b) ||
|
|
234
|
+
!Number.isInteger(idxB) ||
|
|
235
|
+
idxB < 0 ||
|
|
236
|
+
!Number.isInteger(lenB) ||
|
|
237
|
+
lenB < 0
|
|
238
|
+
) {
|
|
239
|
+
throw new Error('invalid argument: b')
|
|
240
|
+
}
|
|
241
|
+
|
|
222
242
|
// Handle INF-XXXXXXXX
|
|
223
243
|
{
|
|
224
|
-
const isInfA = a[
|
|
225
|
-
const isInfB = b[
|
|
244
|
+
const isInfA = a[idxA] === ordI
|
|
245
|
+
const isInfB = b[idxB] === ordI
|
|
226
246
|
if (isInfA !== isInfB) {
|
|
227
247
|
return isInfB ? -1 : 1
|
|
228
248
|
}
|
|
229
249
|
}
|
|
230
250
|
|
|
231
251
|
// Skip leading zeroes
|
|
232
|
-
while (a[
|
|
233
|
-
++
|
|
252
|
+
while (a[idxA] === ordZero) {
|
|
253
|
+
++idxA
|
|
234
254
|
--lenA
|
|
235
255
|
}
|
|
236
|
-
while (b[
|
|
237
|
-
++
|
|
256
|
+
while (b[idxB] === ordZero) {
|
|
257
|
+
++idxB
|
|
238
258
|
--lenB
|
|
239
259
|
}
|
|
240
260
|
|
|
241
261
|
// Compare the revision number
|
|
242
262
|
let result = 0
|
|
243
|
-
while (
|
|
244
|
-
const ac = a[
|
|
245
|
-
const bc = b[
|
|
263
|
+
while (idxA < endA && idxB < endB) {
|
|
264
|
+
const ac = a[idxA++]
|
|
265
|
+
const bc = b[idxB++]
|
|
246
266
|
|
|
247
267
|
const isDashA = ac === ordDash
|
|
248
268
|
const isDashB = bc === ordDash
|
|
@@ -263,9 +283,9 @@ export function compareRevSliceSlice(a, b) {
|
|
|
263
283
|
}
|
|
264
284
|
|
|
265
285
|
// Compare the rest
|
|
266
|
-
while (
|
|
267
|
-
const ac = a[
|
|
268
|
-
const bc = b[
|
|
286
|
+
while (idxA < endA && idxB < endB) {
|
|
287
|
+
const ac = a[idxA++]
|
|
288
|
+
const bc = b[idxB++]
|
|
269
289
|
result = ac - bc
|
|
270
290
|
if (result) {
|
|
271
291
|
return result
|