@ac-kit/format-varint 0.2.6 → 0.2.8

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 CHANGED
@@ -1,5 +1,65 @@
1
1
  # @ac-kit/format-varint
2
2
 
3
+ ## 0.2.8
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [0b4fe43]
8
+ - Updated dependencies [0b4fe43]
9
+ - Updated dependencies [0b4fe43]
10
+ - Updated dependencies [0b4fe43]
11
+ - Updated dependencies [0b4fe43]
12
+ - Updated dependencies [0b4fe43]
13
+ - Updated dependencies [0b4fe43]
14
+ - Updated dependencies [0b4fe43]
15
+ - Updated dependencies [0b4fe43]
16
+ - Updated dependencies [0b4fe43]
17
+ - Updated dependencies [0b4fe43]
18
+ - Updated dependencies [0b4fe43]
19
+ - Updated dependencies [0b4fe43]
20
+ - Updated dependencies [0b4fe43]
21
+ - Updated dependencies [0b4fe43]
22
+ - Updated dependencies [0b4fe43]
23
+ - Updated dependencies [0b4fe43]
24
+ - Updated dependencies [0b4fe43]
25
+ - @ac-kit/core@0.13.0
26
+ - @ac-kit/format-core@0.5.0
27
+
28
+ ## 0.2.7
29
+
30
+ ### Patch Changes
31
+
32
+ - 34e8cfa: An error message that quotes an argument of the wrong kind or value describes
33
+ it with `@ac-kit/core`'s `describeValue`, so building the message never throws
34
+ for a bigint, a symbol or a cyclic object, and `-0` and a bigint read as such
35
+ (`got 5`, `got "a"`, `got -0`, `5n`). Affected: the ffmpeg and ffprobe argument
36
+ printers and `runFfmpeg`/`runFfprobe` (names, specifiers, stream kinds, log
37
+ levels, entries, seconds, counts, inputs, `progressIntervalMs`,
38
+ `maxOutputBytes`), `cssColorFromRgb`'s components, `encodeHidUnit` and the HID
39
+ field accessors' index, `printHlsPlaylist`'s numbers, the cookie `Max-Age` and
40
+ `toRetryAfterSeconds`, the OSC encoder's integers, `maxPacketSize`, `maxDepth`
41
+ and time tags, `printPathData`'s radii and `fractionDigits`,
42
+ `vlqByteLength`, `quicVarintByteLength` and `encodeBigVlq`, the WARC writer's
43
+ `fractionalSecondDigits` and `block.length`, and the exiftool pool's
44
+ `SourceFile` mismatch.
45
+ - Updated dependencies [34e8cfa]
46
+ - Updated dependencies [34e8cfa]
47
+ - Updated dependencies [34e8cfa]
48
+ - Updated dependencies [34e8cfa]
49
+ - Updated dependencies [34e8cfa]
50
+ - Updated dependencies [34e8cfa]
51
+ - Updated dependencies [34e8cfa]
52
+ - Updated dependencies [34e8cfa]
53
+ - Updated dependencies [34e8cfa]
54
+ - Updated dependencies [34e8cfa]
55
+ - Updated dependencies [34e8cfa]
56
+ - Updated dependencies [34e8cfa]
57
+ - Updated dependencies [34e8cfa]
58
+ - Updated dependencies [34e8cfa]
59
+ - Updated dependencies [34e8cfa]
60
+ - @ac-kit/core@0.12.0
61
+ - @ac-kit/format-core@0.4.2
62
+
3
63
  ## 0.2.6
4
64
 
5
65
  ### 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":"AAAA;;;;;;;;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
+ {"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,CAC/E,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
+ {"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":"AAOA;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,CAAC,WAAW,CAAC,CAwBnE"}
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,CACxD,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,IAA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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":"AAEA;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAgBnD"}
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,CACxE,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"}
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.6",
3
+ "version": "0.2.8",
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.11.0",
49
- "@ac-kit/format-core": "^0.4.1"
48
+ "@ac-kit/core": "^0.13.0",
49
+ "@ac-kit/format-core": "^0.5.0"
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.1.1",
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",