@bcts/envelope-pattern 1.0.0-alpha.20 → 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.
Files changed (52) hide show
  1. package/LICENSE +2 -1
  2. package/README.md +1 -1
  3. package/dist/index.cjs +20 -0
  4. package/dist/index.cjs.map +1 -1
  5. package/dist/index.d.cts.map +1 -1
  6. package/dist/index.d.mts.map +1 -1
  7. package/dist/index.iife.js +20 -0
  8. package/dist/index.iife.js.map +1 -1
  9. package/dist/index.mjs +20 -0
  10. package/dist/index.mjs.map +1 -1
  11. package/package.json +11 -22
  12. package/src/error.ts +4 -0
  13. package/src/format.ts +4 -0
  14. package/src/index.ts +4 -0
  15. package/src/parse/index.ts +4 -0
  16. package/src/parse/token.ts +4 -0
  17. package/src/parse/utils.ts +4 -0
  18. package/src/pattern/dcbor-integration.ts +4 -0
  19. package/src/pattern/index.ts +4 -0
  20. package/src/pattern/leaf/array-pattern.ts +4 -0
  21. package/src/pattern/leaf/bool-pattern.ts +4 -0
  22. package/src/pattern/leaf/byte-string-pattern.ts +4 -0
  23. package/src/pattern/leaf/cbor-pattern.ts +4 -0
  24. package/src/pattern/leaf/date-pattern.ts +4 -0
  25. package/src/pattern/leaf/index.ts +4 -0
  26. package/src/pattern/leaf/known-value-pattern.ts +4 -0
  27. package/src/pattern/leaf/map-pattern.ts +4 -0
  28. package/src/pattern/leaf/null-pattern.ts +4 -0
  29. package/src/pattern/leaf/number-pattern.ts +4 -0
  30. package/src/pattern/leaf/tagged-pattern.ts +4 -0
  31. package/src/pattern/leaf/text-pattern.ts +4 -0
  32. package/src/pattern/matcher.ts +4 -0
  33. package/src/pattern/meta/and-pattern.ts +4 -0
  34. package/src/pattern/meta/any-pattern.ts +4 -0
  35. package/src/pattern/meta/capture-pattern.ts +4 -0
  36. package/src/pattern/meta/group-pattern.ts +4 -0
  37. package/src/pattern/meta/index.ts +4 -0
  38. package/src/pattern/meta/not-pattern.ts +4 -0
  39. package/src/pattern/meta/or-pattern.ts +4 -0
  40. package/src/pattern/meta/search-pattern.ts +4 -0
  41. package/src/pattern/meta/traverse-pattern.ts +4 -0
  42. package/src/pattern/structure/assertions-pattern.ts +4 -0
  43. package/src/pattern/structure/digest-pattern.ts +4 -0
  44. package/src/pattern/structure/index.ts +4 -0
  45. package/src/pattern/structure/leaf-structure-pattern.ts +4 -0
  46. package/src/pattern/structure/node-pattern.ts +4 -0
  47. package/src/pattern/structure/object-pattern.ts +4 -0
  48. package/src/pattern/structure/obscured-pattern.ts +4 -0
  49. package/src/pattern/structure/predicate-pattern.ts +4 -0
  50. package/src/pattern/structure/subject-pattern.ts +4 -0
  51. package/src/pattern/structure/wrapped-pattern.ts +4 -0
  52. package/src/pattern/vm.ts +4 -0
package/package.json CHANGED
@@ -1,29 +1,18 @@
1
1
  {
2
2
  "name": "@bcts/envelope-pattern",
3
- "version": "1.0.0-alpha.20",
3
+ "version": "1.0.0-alpha.21",
4
4
  "type": "module",
5
5
  "description": "Pattern matching for Gordian Envelope structures",
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": "git+https://github.com/leonardocustodio/bcts.git",
11
+ "url": "git+https://github.com/paritytech/bcts.git",
23
12
  "directory": "packages/envelope-pattern"
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",
@@ -59,17 +48,17 @@
59
48
  "devDependencies": {
60
49
  "@bcts/eslint": "^0.1.0",
61
50
  "@bcts/tsconfig": "^0.1.0",
62
- "eslint": "^9.39.2",
51
+ "eslint": "^10.0.2",
63
52
  "tsdown": "^0.20.3",
64
- "typedoc": "^0.28.16",
53
+ "typedoc": "^0.28.17",
65
54
  "typescript": "^5.9.3",
66
55
  "vitest": "^4.0.18"
67
56
  },
68
57
  "dependencies": {
69
- "@bcts/dcbor": "^1.0.0-alpha.20",
70
- "@bcts/dcbor-parse": "^1.0.0-alpha.20",
71
- "@bcts/dcbor-pattern": "^1.0.0-alpha.20",
72
- "@bcts/envelope": "^1.0.0-alpha.20",
73
- "@bcts/known-values": "^1.0.0-alpha.20"
58
+ "@bcts/dcbor": "^1.0.0-alpha.21",
59
+ "@bcts/dcbor-parse": "^1.0.0-alpha.21",
60
+ "@bcts/dcbor-pattern": "^1.0.0-alpha.21",
61
+ "@bcts/envelope": "^1.0.0-alpha.21",
62
+ "@bcts/known-values": "^1.0.0-alpha.21"
74
63
  }
75
64
  }
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
  * @bcts/envelope-pattern - Error types for envelope pattern parsing
3
7
  *
4
8
  * This is a 1:1 TypeScript port of bc-envelope-pattern-rust error.rs
package/src/format.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
  * @bcts/envelope-pattern - Path formatting utilities
3
7
  *
4
8
  * This is a 1:1 TypeScript port of bc-envelope-pattern-rust format.rs
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
  * @bcts/envelope-pattern - Pattern matching for Gordian Envelope structures
3
7
  *
4
8
  * This is a 1:1 TypeScript port of bc-envelope-pattern-rust.
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * @bcts/envelope-pattern - Parser entry point
3
7
  *
4
8
  * This is a 1:1 TypeScript port of bc-envelope-pattern-rust parse/mod.rs
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * @bcts/envelope-pattern - Token types and Lexer
3
7
  *
4
8
  * This is a 1:1 TypeScript port of bc-envelope-pattern-rust token.rs
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * @bcts/envelope-pattern - Parser utility functions
3
7
  *
4
8
  * This is a 1:1 TypeScript port of bc-envelope-pattern-rust utils.rs
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * @bcts/envelope-pattern - DCBor Pattern Integration
3
7
  *
4
8
  * This module provides integration between dcbor-pattern and
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * @bcts/envelope-pattern - Pattern module
3
7
  *
4
8
  * This is a 1:1 TypeScript port of bc-envelope-pattern-rust pattern/mod.rs
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * @bcts/envelope-pattern - Array pattern matching
3
7
  *
4
8
  * This is a 1:1 TypeScript port of bc-envelope-pattern-rust array_pattern.rs
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * @bcts/envelope-pattern - Boolean pattern matching
3
7
  *
4
8
  * This is a 1:1 TypeScript port of bc-envelope-pattern-rust bool_pattern.rs
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * @bcts/envelope-pattern - Byte string pattern matching
3
7
  *
4
8
  * This is a 1:1 TypeScript port of bc-envelope-pattern-rust byte_string_pattern.rs
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * @bcts/envelope-pattern - CBOR pattern matching
3
7
  *
4
8
  * This is a 1:1 TypeScript port of bc-envelope-pattern-rust cbor_pattern.rs
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * @bcts/envelope-pattern - Date pattern matching
3
7
  *
4
8
  * This is a 1:1 TypeScript port of bc-envelope-pattern-rust date_pattern.rs
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * @bcts/envelope-pattern - Leaf patterns module
3
7
  *
4
8
  * This is a 1:1 TypeScript port of bc-envelope-pattern-rust pattern/leaf/mod.rs
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * @bcts/envelope-pattern - Known value pattern matching
3
7
  *
4
8
  * This is a 1:1 TypeScript port of bc-envelope-pattern-rust known_value_pattern.rs
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * @bcts/envelope-pattern - Map pattern matching
3
7
  *
4
8
  * This is a 1:1 TypeScript port of bc-envelope-pattern-rust map_pattern.rs
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * @bcts/envelope-pattern - Null pattern matching
3
7
  *
4
8
  * This is a 1:1 TypeScript port of bc-envelope-pattern-rust null_pattern.rs
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * @bcts/envelope-pattern - Number pattern matching
3
7
  *
4
8
  * This is a 1:1 TypeScript port of bc-envelope-pattern-rust number_pattern.rs
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * @bcts/envelope-pattern - Tagged pattern matching
3
7
  *
4
8
  * This is a 1:1 TypeScript port of bc-envelope-pattern-rust tagged_pattern.rs
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * @bcts/envelope-pattern - Text pattern matching
3
7
  *
4
8
  * This is a 1:1 TypeScript port of bc-envelope-pattern-rust text_pattern.rs
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * @bcts/envelope-pattern - Matcher interface
3
7
  *
4
8
  * This is a 1:1 TypeScript port of bc-envelope-pattern-rust matcher.rs
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * @bcts/envelope-pattern - And pattern matching
3
7
  *
4
8
  * This is a 1:1 TypeScript port of bc-envelope-pattern-rust and_pattern.rs
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * @bcts/envelope-pattern - Any pattern matching
3
7
  *
4
8
  * This is a 1:1 TypeScript port of bc-envelope-pattern-rust any_pattern.rs
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * @bcts/envelope-pattern - Capture pattern matching
3
7
  *
4
8
  * This is a 1:1 TypeScript port of bc-envelope-pattern-rust capture_pattern.rs
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * @bcts/envelope-pattern - Group/repeat pattern matching
3
7
  *
4
8
  * This is a 1:1 TypeScript port of bc-envelope-pattern-rust repeat_pattern.rs
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * @bcts/envelope-pattern - Meta patterns module
3
7
  *
4
8
  * This is a 1:1 TypeScript port of bc-envelope-pattern-rust pattern/meta/mod.rs
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * @bcts/envelope-pattern - Not pattern matching
3
7
  *
4
8
  * This is a 1:1 TypeScript port of bc-envelope-pattern-rust not_pattern.rs
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * @bcts/envelope-pattern - Or pattern matching
3
7
  *
4
8
  * This is a 1:1 TypeScript port of bc-envelope-pattern-rust or_pattern.rs
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * @bcts/envelope-pattern - Search pattern matching
3
7
  *
4
8
  * This is a 1:1 TypeScript port of bc-envelope-pattern-rust search_pattern.rs
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * @bcts/envelope-pattern - Traverse pattern matching
3
7
  *
4
8
  * This is a 1:1 TypeScript port of bc-envelope-pattern-rust traverse_pattern.rs
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * @bcts/envelope-pattern - Assertions pattern matching
3
7
  *
4
8
  * This is a 1:1 TypeScript port of bc-envelope-pattern-rust assertions_pattern.rs
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * @bcts/envelope-pattern - Digest pattern matching
3
7
  *
4
8
  * This is a 1:1 TypeScript port of bc-envelope-pattern-rust digest_pattern.rs
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * @bcts/envelope-pattern - Structure patterns module
3
7
  *
4
8
  * This is a 1:1 TypeScript port of bc-envelope-pattern-rust pattern/structure/mod.rs
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * @bcts/envelope-pattern - Leaf structure pattern matching
3
7
  *
4
8
  * This is a 1:1 TypeScript port of bc-envelope-pattern-rust leaf_structure_pattern.rs
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * @bcts/envelope-pattern - Node pattern matching
3
7
  *
4
8
  * This is a 1:1 TypeScript port of bc-envelope-pattern-rust node_pattern.rs
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * @bcts/envelope-pattern - Object pattern matching
3
7
  *
4
8
  * This is a 1:1 TypeScript port of bc-envelope-pattern-rust object_pattern.rs
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * @bcts/envelope-pattern - Obscured pattern matching
3
7
  *
4
8
  * This is a 1:1 TypeScript port of bc-envelope-pattern-rust obscured_pattern.rs
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * @bcts/envelope-pattern - Predicate pattern matching
3
7
  *
4
8
  * This is a 1:1 TypeScript port of bc-envelope-pattern-rust predicate_pattern.rs
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * @bcts/envelope-pattern - Subject pattern matching
3
7
  *
4
8
  * This is a 1:1 TypeScript port of bc-envelope-pattern-rust subject_pattern.rs
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * @bcts/envelope-pattern - Wrapped pattern matching
3
7
  *
4
8
  * This is a 1:1 TypeScript port of bc-envelope-pattern-rust wrapped_pattern.rs
package/src/pattern/vm.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
  * @bcts/envelope-pattern - VM instructions and executor
3
7
  *
4
8
  * This is a 1:1 TypeScript port of bc-envelope-pattern-rust vm.rs