@bcts/dcbor 1.0.0-alpha.19 → 1.0.0-alpha.21

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 CHANGED
@@ -1,29 +1,18 @@
1
1
  {
2
2
  "name": "@bcts/dcbor",
3
- "version": "1.0.0-alpha.19",
3
+ "version": "1.0.0-alpha.21",
4
4
  "type": "module",
5
5
  "description": "Blockchain Commons Deterministic CBOR (dCBOR) for TypeScript",
6
6
  "license": "BSD-2-Clause-Patent",
7
- "contributors": [
8
- {
9
- "name": "Leonardo Custodio",
10
- "email": "leonardo.custodio@parity.io",
11
- "url": "https://github.com/leonardocustodio"
12
- },
13
- {
14
- "name": "Karim Jedda",
15
- "email": "karim@parity.io",
16
- "url": "https://github.com/KarimJedda"
17
- }
18
- ],
7
+ "author": "Parity Technologies <admin@parity.io> (https://parity.io)",
19
8
  "homepage": "https://bcts.dev",
20
9
  "repository": {
21
10
  "type": "git",
22
- "url": "https://github.com/leonardocustodio/bcts",
11
+ "url": "https://github.com/paritytech/bcts",
23
12
  "directory": "packages/dcbor"
24
13
  },
25
14
  "bugs": {
26
- "url": "https://github.com/leonardocustodio/bcts/issues"
15
+ "url": "https://github.com/paritytech/bcts/issues"
27
16
  },
28
17
  "main": "dist/index.cjs",
29
18
  "module": "dist/index.mjs",
@@ -69,15 +58,15 @@
69
58
  "devDependencies": {
70
59
  "@bcts/eslint": "^0.1.0",
71
60
  "@bcts/tsconfig": "^0.1.0",
72
- "@eslint/js": "^9.39.2",
61
+ "@eslint/js": "^10.0.1",
73
62
  "@types/collections": "^5.1.5",
74
- "@types/node": "^25.2.1",
75
- "@typescript-eslint/eslint-plugin": "^8.54.0",
76
- "@typescript-eslint/parser": "^8.54.0",
77
- "eslint": "^9.39.2",
63
+ "@types/node": "^25.3.2",
64
+ "@typescript-eslint/eslint-plugin": "^8.56.1",
65
+ "@typescript-eslint/parser": "^8.56.1",
66
+ "eslint": "^10.0.2",
78
67
  "ts-node": "^10.9.2",
79
68
  "tsdown": "^0.20.3",
80
- "typedoc": "^0.28.16",
69
+ "typedoc": "^0.28.17",
81
70
  "typescript": "^5.9.3",
82
71
  "vitest": "^4.0.18"
83
72
  },
package/src/bignum.ts CHANGED
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * CBOR bignum (tags 2 and 3) support.
3
7
  *
4
8
  * This module provides conversion between CBOR and JavaScript BigInt types,
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * Byte string utilities for dCBOR.
3
7
  *
4
8
  * Represents a CBOR byte string (major type 2).
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * CBOR Encoding and Decoding Interfaces.
3
7
  *
4
8
  * These interfaces provide functionality for converting between TypeScript types and
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * Tagged CBOR encoding and decoding support.
3
7
  *
4
8
  * This module provides the `CborTaggedCodable` interface, which serves as a
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * Tagged CBOR decoding support.
3
7
  *
4
8
  * This module provides the `CborTaggedDecodable` interface, which enables types to
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * Tagged CBOR encoding support.
3
7
  *
4
8
  * This module provides the `CborTaggedEncodable` interface, which enables types to
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * Base trait for types that have associated CBOR tags.
3
7
  *
4
8
  * CBOR allows values to be "tagged" with semantic information using tag
package/src/cbor.ts CHANGED
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ */
6
+
1
7
  import { CborMap } from "./map";
2
8
  import type { Simple } from "./simple";
3
9
  import { simpleCborData, isFloat as isSimpleFloat } from "./simple";
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * Convenience utilities for working with CBOR values.
3
7
  *
4
8
  * Provides type-safe helpers for checking types, extracting values,
package/src/date.ts CHANGED
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * Date/time support for CBOR with tag(1) encoding.
3
7
  *
4
8
  * A CBOR-friendly representation of a date and time.
package/src/decode.ts CHANGED
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ */
6
+
1
7
  import {
2
8
  type Cbor,
3
9
  type CborNumber,
package/src/diag.ts CHANGED
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * Enhanced diagnostic formatting for CBOR values.
3
7
  *
4
8
  * Provides multiple formatting options including
package/src/dump.ts CHANGED
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * Hex dump utilities for CBOR data.
3
7
  *
4
8
  * Affordances for viewing the encoded binary representation of CBOR as hexadecimal.
package/src/error.ts CHANGED
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * Error types for CBOR encoding and decoding.
3
7
  *
4
8
  * @module error
package/src/exact.ts CHANGED
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * Exact numeric conversions.
3
7
  *
4
8
  * This module is based on the Swift `exactly` initializers.
package/src/float.ts CHANGED
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * Float encoding and conversion utilities for dCBOR.
3
7
  *
4
8
  * # Floating Point Number Support in dCBOR
package/src/global.d.ts CHANGED
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * Global type declarations for cross-platform APIs
3
7
  */
4
8
 
package/src/globals.d.ts CHANGED
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ */
package/src/index.ts CHANGED
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * BC-DCBOR TypeScript Library
3
7
  *
4
8
  * A TypeScript implementation of Blockchain Commons' Deterministic CBOR (dCBOR).
package/src/map.ts CHANGED
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * Map Support in dCBOR
3
7
  *
4
8
  * A deterministic CBOR map implementation that ensures maps with the same
package/src/prelude.ts CHANGED
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * Prelude module - Re-exports commonly used types and classes.
3
7
  *
4
8
  * This module provides a curated set of imports matching Rust's prelude.rs.
package/src/set.ts CHANGED
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * Set data structure for CBOR with tag(258) encoding.
3
7
  *
4
8
  * A Set is encoded as an array with no duplicate elements,
package/src/simple.ts CHANGED
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * CBOR Simple Values (Major Type 7).
3
7
  *
4
8
  * @module simple
package/src/stdlib.ts CHANGED
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * Standard library re-exports and compatibility layer.
3
7
  *
4
8
  * In Rust, this handles std/no_std feature flags.
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * String utilities for dCBOR, including Unicode normalization.
3
7
  *
4
8
  * @module string-util
package/src/tag.ts CHANGED
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * CBOR Tag support for semantic tagging of values.
3
7
  *
4
8
  * Tags provide semantic information about CBOR data items.
package/src/tags-store.ts CHANGED
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * Tag registry and management system.
3
7
  *
4
8
  * The TagsStore provides a centralized registry for CBOR tags,
package/src/tags.ts CHANGED
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * Standard CBOR tag definitions from the IANA registry.
3
7
  *
4
8
  * @module tags
package/src/varint.ts CHANGED
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ */
6
+
1
7
  import { type CborNumber, isCborNumber, type MajorType } from "./cbor";
2
8
  import { hasFractionalPart } from "./float";
3
9
  import { CborError } from "./error";
package/src/walk.ts CHANGED
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * Tree traversal system for CBOR data structures.
3
7
  *
4
8
  * This module provides a visitor pattern implementation for traversing
@@ -209,17 +213,15 @@ function walkInternal<State>(
209
213
  skipVisit = false,
210
214
  ): State {
211
215
  let currentState = state;
212
- let stopDescent = false;
213
216
 
214
217
  // Visit the current element (unless skipVisit is true)
215
218
  if (!skipVisit) {
216
219
  const element: WalkElement = { type: "single", cbor };
217
220
  const [newState, stop] = visitor(element, level, edge, currentState);
218
221
  currentState = newState;
219
- stopDescent = stop;
220
222
 
221
223
  // If visitor says to stop descending, return immediately
222
- if (stopDescent) {
224
+ if (stop) {
223
225
  return currentState;
224
226
  }
225
227
  }