@ac-kit/format-varint 0.2.6 → 0.2.7
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/CHANGELOG.md +35 -0
- package/dist/quic/quic-varint-byte-length.d.ts.map +1 -1
- package/dist/quic/quic-varint-byte-length.js +2 -1
- package/dist/quic/quic-varint-byte-length.js.map +1 -1
- package/dist/vlq/encode-big-vlq.d.ts.map +1 -1
- package/dist/vlq/encode-big-vlq.js +2 -1
- package/dist/vlq/encode-big-vlq.js.map +1 -1
- package/dist/vlq/vlq-byte-length.d.ts.map +1 -1
- package/dist/vlq/vlq-byte-length.js +2 -1
- package/dist/vlq/vlq-byte-length.js.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,40 @@
|
|
|
1
1
|
# @ac-kit/format-varint
|
|
2
2
|
|
|
3
|
+
## 0.2.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 34e8cfa: An error message that quotes an argument of the wrong kind or value describes
|
|
8
|
+
it with `@ac-kit/core`'s `describeValue`, so building the message never throws
|
|
9
|
+
for a bigint, a symbol or a cyclic object, and `-0` and a bigint read as such
|
|
10
|
+
(`got 5`, `got "a"`, `got -0`, `5n`). Affected: the ffmpeg and ffprobe argument
|
|
11
|
+
printers and `runFfmpeg`/`runFfprobe` (names, specifiers, stream kinds, log
|
|
12
|
+
levels, entries, seconds, counts, inputs, `progressIntervalMs`,
|
|
13
|
+
`maxOutputBytes`), `cssColorFromRgb`'s components, `encodeHidUnit` and the HID
|
|
14
|
+
field accessors' index, `printHlsPlaylist`'s numbers, the cookie `Max-Age` and
|
|
15
|
+
`toRetryAfterSeconds`, the OSC encoder's integers, `maxPacketSize`, `maxDepth`
|
|
16
|
+
and time tags, `printPathData`'s radii and `fractionDigits`,
|
|
17
|
+
`vlqByteLength`, `quicVarintByteLength` and `encodeBigVlq`, the WARC writer's
|
|
18
|
+
`fractionalSecondDigits` and `block.length`, and the exiftool pool's
|
|
19
|
+
`SourceFile` mismatch.
|
|
20
|
+
- Updated dependencies [34e8cfa]
|
|
21
|
+
- Updated dependencies [34e8cfa]
|
|
22
|
+
- Updated dependencies [34e8cfa]
|
|
23
|
+
- Updated dependencies [34e8cfa]
|
|
24
|
+
- Updated dependencies [34e8cfa]
|
|
25
|
+
- Updated dependencies [34e8cfa]
|
|
26
|
+
- Updated dependencies [34e8cfa]
|
|
27
|
+
- Updated dependencies [34e8cfa]
|
|
28
|
+
- Updated dependencies [34e8cfa]
|
|
29
|
+
- Updated dependencies [34e8cfa]
|
|
30
|
+
- Updated dependencies [34e8cfa]
|
|
31
|
+
- Updated dependencies [34e8cfa]
|
|
32
|
+
- Updated dependencies [34e8cfa]
|
|
33
|
+
- Updated dependencies [34e8cfa]
|
|
34
|
+
- Updated dependencies [34e8cfa]
|
|
35
|
+
- @ac-kit/core@0.12.0
|
|
36
|
+
- @ac-kit/format-core@0.4.2
|
|
37
|
+
|
|
3
38
|
## 0.2.6
|
|
4
39
|
|
|
5
40
|
### Patch Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quic-varint-byte-length.d.ts","sourceRoot":"","sources":["../../src/quic/quic-varint-byte-length.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"quic-varint-byte-length.d.ts","sourceRoot":"","sources":["../../src/quic/quic-varint-byte-length.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAgBjE;AAED;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,MAAM,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAYxE"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { describeValue } from "@ac-kit/core";
|
|
1
2
|
/**
|
|
2
3
|
* How many bytes {@link encodeQuicVarint} will produce for `value`: the shortest
|
|
3
4
|
* of the four QUIC lengths that holds it.
|
|
@@ -9,7 +10,7 @@
|
|
|
9
10
|
*/
|
|
10
11
|
export function quicVarintByteLength(value) {
|
|
11
12
|
if (!Number.isSafeInteger(value) || value < 0) {
|
|
12
|
-
throw new RangeError(`quicVarintByteLength: value must be a non-negative safe integer, got ${value}`);
|
|
13
|
+
throw new RangeError(`quicVarintByteLength: value must be a non-negative safe integer, got ${describeValue(value)}`);
|
|
13
14
|
}
|
|
14
15
|
if (value < 0x40) {
|
|
15
16
|
return 1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quic-varint-byte-length.js","sourceRoot":"","sources":["../../src/quic/quic-varint-byte-length.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,UAAU,oBAAoB,CAAC,KAAa;IACjD,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC;QAC/C,MAAM,IAAI,UAAU,CACnB,wEAAwE,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"quic-varint-byte-length.js","sourceRoot":"","sources":["../../src/quic/quic-varint-byte-length.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C;;;;;;;;GAQG;AACH,MAAM,UAAU,oBAAoB,CAAC,KAAa;IACjD,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC;QAC/C,MAAM,IAAI,UAAU,CACnB,wEAAwE,aAAa,CAAC,KAAK,CAAC,EAAE,CAC9F,CAAC;IACH,CAAC;IACD,IAAI,KAAK,GAAG,IAAI,EAAE,CAAC;QAClB,OAAO,CAAC,CAAC;IACV,CAAC;IACD,IAAI,KAAK,GAAG,MAAM,EAAE,CAAC;QACpB,OAAO,CAAC,CAAC;IACV,CAAC;IACD,IAAI,KAAK,GAAG,UAAW,EAAE,CAAC;QACzB,OAAO,CAAC,CAAC;IACV,CAAC;IACD,OAAO,CAAC,CAAC;AACV,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,uBAAuB,CAAC,SAAiB;IACxD,4DAA4D;IAC5D,QAAQ,SAAS,KAAK,CAAC,EAAE,CAAC;QACzB,KAAK,CAAC;YACL,OAAO,CAAC,CAAC;QACV,KAAK,CAAC;YACL,OAAO,CAAC,CAAC;QACV,KAAK,CAAC;YACL,OAAO,CAAC,CAAC;QACV;YACC,OAAO,CAAC,CAAC;IACX,CAAC;AACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"encode-big-vlq.d.ts","sourceRoot":"","sources":["../../src/vlq/encode-big-vlq.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"encode-big-vlq.d.ts","sourceRoot":"","sources":["../../src/vlq/encode-big-vlq.ts"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,CAAC,WAAW,CAAC,CAwBnE"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { describeValue } from "@ac-kit/core";
|
|
1
2
|
import { CONTINUATION_BIT, PAYLOAD_BITS, PAYLOAD_MASK_BIG, RADIX_BIG, } from "../_base128.js";
|
|
2
3
|
/**
|
|
3
4
|
* Encodes a non-negative `bigint` as a base-128 VLQ — the unbounded counterpart
|
|
@@ -17,7 +18,7 @@ import { CONTINUATION_BIT, PAYLOAD_BITS, PAYLOAD_MASK_BIG, RADIX_BIG, } from "..
|
|
|
17
18
|
*/
|
|
18
19
|
export function encodeBigVlq(value) {
|
|
19
20
|
if (value < 0n) {
|
|
20
|
-
throw new RangeError(`encodeBigVlq: value must be non-negative, got ${value}`);
|
|
21
|
+
throw new RangeError(`encodeBigVlq: value must be non-negative, got ${describeValue(value)}`);
|
|
21
22
|
}
|
|
22
23
|
let length = 1;
|
|
23
24
|
for (let remaining = value; remaining >= RADIX_BIG; remaining /= RADIX_BIG) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"encode-big-vlq.js","sourceRoot":"","sources":["../../src/vlq/encode-big-vlq.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,gBAAgB,EAChB,YAAY,EACZ,gBAAgB,EAChB,SAAS,GACT,MAAM,gBAAgB,CAAC;AAExB;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,YAAY,CAAC,KAAa;IACzC,IAAI,KAAK,GAAG,EAAE,EAAE,CAAC;QAChB,MAAM,IAAI,UAAU,CACnB,iDAAiD,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"encode-big-vlq.js","sourceRoot":"","sources":["../../src/vlq/encode-big-vlq.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,EACN,gBAAgB,EAChB,YAAY,EACZ,gBAAgB,EAChB,SAAS,GACT,MAAM,gBAAgB,CAAC;AAExB;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,YAAY,CAAC,KAAa;IACzC,IAAI,KAAK,GAAG,EAAE,EAAE,CAAC;QAChB,MAAM,IAAI,UAAU,CACnB,iDAAiD,aAAa,CAAC,KAAK,CAAC,EAAE,CACvE,CAAC;IACH,CAAC;IAED,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,KAAK,IAAI,SAAS,GAAG,KAAK,EAAE,SAAS,IAAI,SAAS,EAAE,SAAS,IAAI,SAAS,EAAE,CAAC;QAC5E,MAAM,EAAE,CAAC;IACV,CAAC;IAED,MAAM,GAAG,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;IACnC,IAAI,SAAS,GAAG,KAAK,CAAC;IAEtB,uEAAuE;IACvE,qEAAqE;IACrE,KAAK,IAAI,KAAK,GAAG,MAAM,GAAG,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC;QAClD,MAAM,KAAK,GAAG,MAAM,CAAC,SAAS,GAAG,gBAAgB,CAAC,CAAC;QACnD,GAAG,CAAC,KAAK,CAAC,GAAG,KAAK,KAAK,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,GAAG,gBAAgB,CAAC;QACrE,SAAS,KAAK,YAAY,CAAC;IAC5B,CAAC;IAED,OAAO,GAAG,CAAC;AACZ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vlq-byte-length.d.ts","sourceRoot":"","sources":["../../src/vlq/vlq-byte-length.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"vlq-byte-length.d.ts","sourceRoot":"","sources":["../../src/vlq/vlq-byte-length.ts"],"names":[],"mappings":"AAIA;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAgBnD"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { describeValue } from "@ac-kit/core";
|
|
1
2
|
import { RADIX } from "../_base128.js";
|
|
2
3
|
/**
|
|
3
4
|
* How many bytes {@link encodeVlq} will produce for `value`.
|
|
@@ -11,7 +12,7 @@ import { RADIX } from "../_base128.js";
|
|
|
11
12
|
*/
|
|
12
13
|
export function vlqByteLength(value) {
|
|
13
14
|
if (!Number.isSafeInteger(value) || value < 0) {
|
|
14
|
-
throw new RangeError(`vlqByteLength: value must be a non-negative safe integer, got ${value}`);
|
|
15
|
+
throw new RangeError(`vlqByteLength: value must be a non-negative safe integer, got ${describeValue(value)}`);
|
|
15
16
|
}
|
|
16
17
|
let length = 1;
|
|
17
18
|
let remaining = value;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vlq-byte-length.js","sourceRoot":"","sources":["../../src/vlq/vlq-byte-length.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEvC;;;;;;;;;GASG;AACH,MAAM,UAAU,aAAa,CAAC,KAAa;IAC1C,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC;QAC/C,MAAM,IAAI,UAAU,CACnB,iEAAiE,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"vlq-byte-length.js","sourceRoot":"","sources":["../../src/vlq/vlq-byte-length.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEvC;;;;;;;;;GASG;AACH,MAAM,UAAU,aAAa,CAAC,KAAa;IAC1C,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC;QAC/C,MAAM,IAAI,UAAU,CACnB,iEAAiE,aAAa,CAAC,KAAK,CAAC,EAAE,CACvF,CAAC;IACH,CAAC;IAED,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,IAAI,SAAS,GAAG,KAAK,CAAC;IAEtB,OAAO,SAAS,IAAI,KAAK,EAAE,CAAC;QAC3B,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC,CAAC;QAC1C,MAAM,EAAE,CAAC;IACV,CAAC;IAED,OAAO,MAAM,CAAC;AACf,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ac-kit/format-varint",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.7",
|
|
4
4
|
"description": "Variable-length integer encodings: LEB128, VLQ and the other self-delimiting integer formats.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"encoding",
|
|
@@ -45,13 +45,13 @@
|
|
|
45
45
|
"prepack": "yarn build"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@ac-kit/core": "^0.
|
|
49
|
-
"@ac-kit/format-core": "^0.4.
|
|
48
|
+
"@ac-kit/core": "^0.12.0",
|
|
49
|
+
"@ac-kit/format-core": "^0.4.2"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@ac-kit/tsconfig": "0.1.0",
|
|
53
53
|
"@ac-kit/typedoc-config": "0.1.0",
|
|
54
|
-
"@ac-kit/vitest-config": "0.
|
|
54
|
+
"@ac-kit/vitest-config": "0.2.0",
|
|
55
55
|
"@types/node": "^26.5.1",
|
|
56
56
|
"@typescript/native": "typescript@7.0.2",
|
|
57
57
|
"rimraf": "6.1.4",
|