@cdk8s/awscdk-resolver 0.0.608 → 0.0.610

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 (145) hide show
  1. package/.jsii +3 -3
  2. package/lib/resolve.js +1 -1
  3. package/node_modules/@aws-sdk/client-cloudformation/package.json +3 -3
  4. package/node_modules/@aws-sdk/core/package.json +2 -2
  5. package/node_modules/@aws-sdk/credential-provider-env/package.json +2 -2
  6. package/node_modules/@aws-sdk/credential-provider-http/package.json +2 -2
  7. package/node_modules/@aws-sdk/credential-provider-ini/package.json +9 -9
  8. package/node_modules/@aws-sdk/credential-provider-login/package.json +3 -3
  9. package/node_modules/@aws-sdk/credential-provider-node/package.json +7 -7
  10. package/node_modules/@aws-sdk/credential-provider-process/package.json +2 -2
  11. package/node_modules/@aws-sdk/credential-provider-sso/package.json +4 -4
  12. package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +3 -3
  13. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +1 -1
  14. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +1 -1
  15. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +1 -1
  16. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +1 -1
  17. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +1 -1
  18. package/node_modules/@aws-sdk/nested-clients/package.json +2 -2
  19. package/node_modules/@aws-sdk/token-providers/package.json +3 -3
  20. package/node_modules/@aws-sdk/xml-builder/dist-cjs/xml-parser.browser.js +1 -1
  21. package/node_modules/@aws-sdk/xml-builder/dist-cjs/xml-parser.js +233 -43
  22. package/node_modules/@aws-sdk/xml-builder/dist-es/xml-parser.browser.js +1 -1
  23. package/node_modules/@aws-sdk/xml-builder/dist-es/xml-parser.js +233 -43
  24. package/node_modules/@aws-sdk/xml-builder/dist-types/ts3.4/xml-parser.d.ts +1 -1
  25. package/node_modules/@aws-sdk/xml-builder/dist-types/xml-parser.d.ts +2 -1
  26. package/node_modules/@aws-sdk/xml-builder/package.json +4 -4
  27. package/node_modules/@smithy/core/dist-cjs/submodules/cbor/index.js +518 -371
  28. package/node_modules/@smithy/core/dist-cjs/submodules/client/index.js +1 -1
  29. package/node_modules/@smithy/core/dist-es/submodules/cbor/cbor-decode.js +326 -269
  30. package/node_modules/@smithy/core/dist-es/submodules/cbor/cbor-encode.js +192 -103
  31. package/node_modules/@smithy/core/dist-es/submodules/cbor/cbor.js +4 -2
  32. package/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/get-value-from-text-node.js +1 -1
  33. package/node_modules/@smithy/core/dist-types/submodules/cbor/cbor-decode.d.ts +4 -0
  34. package/node_modules/@smithy/core/dist-types/submodules/cbor/cbor-encode.d.ts +8 -4
  35. package/node_modules/@smithy/core/package.json +1 -1
  36. package/node_modules/@smithy/credential-provider-imds/package.json +2 -2
  37. package/node_modules/@smithy/fetch-http-handler/package.json +2 -2
  38. package/node_modules/@smithy/node-http-handler/package.json +2 -2
  39. package/node_modules/@smithy/signature-v4/package.json +2 -2
  40. package/package.json +6 -6
  41. package/node_modules/@aws-sdk/xml-builder/dist-cjs/xml-external/nodable_entities.js +0 -333
  42. package/node_modules/@aws-sdk/xml-builder/dist-es/xml-external/nodable_entities.js +0 -332
  43. package/node_modules/@aws-sdk/xml-builder/dist-types/ts3.4/xml-external/nodable_entities.d.ts +0 -66
  44. package/node_modules/@aws-sdk/xml-builder/dist-types/xml-external/nodable_entities.d.ts +0 -65
  45. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/CHANGELOG.md +0 -827
  46. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/LICENSE +0 -21
  47. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/README.md +0 -202
  48. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxbuilder.min.js +0 -2
  49. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxbuilder.min.js.map +0 -1
  50. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxp.cjs +0 -1
  51. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxp.d.cts +0 -770
  52. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxp.min.js +0 -2
  53. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxp.min.js.map +0 -1
  54. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxparser.min.js +0 -2
  55. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxparser.min.js.map +0 -1
  56. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxvalidator.min.js +0 -2
  57. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxvalidator.min.js.map +0 -1
  58. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/package.json +0 -93
  59. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/cli/cli.js +0 -97
  60. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/cli/man.js +0 -17
  61. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/cli/read.js +0 -43
  62. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/fxp.d.ts +0 -739
  63. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/fxp.js +0 -14
  64. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/ignoreAttributes.js +0 -18
  65. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/util.js +0 -61
  66. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/CharsSymbol.js +0 -16
  67. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/EntitiesParser.js +0 -106
  68. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/OptionsBuilder.js +0 -61
  69. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/OutputBuilders/BaseOutputBuilder.js +0 -69
  70. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsArrBuilder.js +0 -103
  71. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsMinArrBuilder.js +0 -100
  72. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsObjBuilder.js +0 -154
  73. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/OutputBuilders/ParserOptionsBuilder.js +0 -94
  74. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/Report.js +0 -0
  75. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/TagPath.js +0 -81
  76. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/TagPathMatcher.js +0 -13
  77. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/XMLParser.js +0 -83
  78. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/Xml2JsParser.js +0 -235
  79. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/XmlPartReader.js +0 -210
  80. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/XmlSpecialTagsReader.js +0 -111
  81. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/inputSource/BufferSource.js +0 -116
  82. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/inputSource/StringSource.js +0 -121
  83. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/valueParsers/EntitiesParser.js +0 -105
  84. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/valueParsers/booleanParser.js +0 -22
  85. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/valueParsers/booleanParserExt.js +0 -19
  86. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/valueParsers/currency.js +0 -38
  87. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/valueParsers/join.js +0 -13
  88. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/valueParsers/number.js +0 -14
  89. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/valueParsers/trim.js +0 -6
  90. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/validator.js +0 -425
  91. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js +0 -6
  92. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js +0 -407
  93. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js +0 -163
  94. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js +0 -840
  95. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/xmlparser/XMLParser.js +0 -71
  96. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/xmlparser/node2json.js +0 -177
  97. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/xmlparser/xmlNode.js +0 -40
  98. package/node_modules/@nodable/entities/README.md +0 -41
  99. package/node_modules/@nodable/entities/package.json +0 -57
  100. package/node_modules/@nodable/entities/src/EntityDecoder.js +0 -644
  101. package/node_modules/@nodable/entities/src/EntityEncoder.js +0 -194
  102. package/node_modules/@nodable/entities/src/entities.js +0 -1159
  103. package/node_modules/@nodable/entities/src/entityTries.js +0 -49
  104. package/node_modules/@nodable/entities/src/index.d.ts +0 -341
  105. package/node_modules/@nodable/entities/src/index.js +0 -29
  106. package/node_modules/anynum/LICENSE +0 -21
  107. package/node_modules/anynum/README.md +0 -142
  108. package/node_modules/anynum/anynum.js +0 -135
  109. package/node_modules/anynum/digitTable.js +0 -116
  110. package/node_modules/anynum/package.json +0 -42
  111. package/node_modules/fast-xml-builder/CHANGELOG.md +0 -40
  112. package/node_modules/fast-xml-builder/LICENSE +0 -21
  113. package/node_modules/fast-xml-builder/README.md +0 -74
  114. package/node_modules/fast-xml-builder/lib/fxb.cjs +0 -1
  115. package/node_modules/fast-xml-builder/lib/fxb.d.cts +0 -270
  116. package/node_modules/fast-xml-builder/lib/fxb.min.js +0 -2
  117. package/node_modules/fast-xml-builder/lib/fxb.min.js.map +0 -1
  118. package/node_modules/fast-xml-builder/package.json +0 -81
  119. package/node_modules/fast-xml-builder/src/fxb.d.ts +0 -270
  120. package/node_modules/fast-xml-builder/src/fxb.js +0 -599
  121. package/node_modules/fast-xml-builder/src/ignoreAttributes.js +0 -18
  122. package/node_modules/fast-xml-builder/src/orderedJs2Xml.js +0 -359
  123. package/node_modules/fast-xml-builder/src/prettifyJs2Xml.js +0 -0
  124. package/node_modules/fast-xml-builder/src/util.js +0 -16
  125. package/node_modules/path-expression-matcher/LICENSE +0 -21
  126. package/node_modules/path-expression-matcher/README.md +0 -947
  127. package/node_modules/path-expression-matcher/lib/pem.cjs +0 -1
  128. package/node_modules/path-expression-matcher/lib/pem.d.cts +0 -715
  129. package/node_modules/path-expression-matcher/lib/pem.min.js +0 -2
  130. package/node_modules/path-expression-matcher/lib/pem.min.js.map +0 -1
  131. package/node_modules/path-expression-matcher/package.json +0 -79
  132. package/node_modules/path-expression-matcher/src/Expression.js +0 -232
  133. package/node_modules/path-expression-matcher/src/ExpressionSet.js +0 -225
  134. package/node_modules/path-expression-matcher/src/Matcher.js +0 -660
  135. package/node_modules/path-expression-matcher/src/index.d.ts +0 -589
  136. package/node_modules/path-expression-matcher/src/index.js +0 -29
  137. package/node_modules/strnum/CHANGELOG.md +0 -51
  138. package/node_modules/strnum/LICENSE +0 -21
  139. package/node_modules/strnum/README.md +0 -113
  140. package/node_modules/strnum/package.json +0 -36
  141. package/node_modules/strnum/strnum.js +0 -171
  142. package/node_modules/xml-naming/README.md +0 -189
  143. package/node_modules/xml-naming/package.json +0 -54
  144. package/node_modules/xml-naming/src/index.d.ts +0 -74
  145. package/node_modules/xml-naming/src/index.js +0 -270
@@ -1,589 +0,0 @@
1
- /**
2
- * TypeScript definitions for path-expression-matcher
3
- *
4
- * Provides efficient path tracking and pattern matching for XML/JSON parsers.
5
- */
6
-
7
- /**
8
- * Options for creating an Expression
9
- */
10
- export interface ExpressionOptions {
11
- /**
12
- * Path separator character
13
- * @default '.'
14
- */
15
- separator?: string;
16
- }
17
-
18
- /**
19
- * Parsed segment from an expression pattern
20
- */
21
- export interface Segment {
22
- /**
23
- * Type of segment
24
- */
25
- type: 'tag' | 'deep-wildcard';
26
-
27
- /**
28
- * Tag name (e.g., "user", "*" for wildcard)
29
- * Only present when type is 'tag'
30
- */
31
- tag?: string;
32
-
33
- /**
34
- * Namespace prefix (e.g., "ns" in "ns::user")
35
- * Only present when namespace is specified
36
- */
37
- namespace?: string;
38
-
39
- /**
40
- * Attribute name to match (e.g., "id" in "user[id]")
41
- * Only present when attribute condition exists
42
- */
43
- attrName?: string;
44
-
45
- /**
46
- * Attribute value to match (e.g., "123" in "user[id=123]")
47
- * Only present when attribute value is specified
48
- */
49
- attrValue?: string;
50
-
51
- /**
52
- * Position selector type
53
- * Only present when position selector exists
54
- */
55
- position?: 'first' | 'last' | 'odd' | 'even' | 'nth';
56
-
57
- /**
58
- * Numeric value for nth() selector
59
- * Only present when position is 'nth'
60
- */
61
- positionValue?: number;
62
- }
63
-
64
- /**
65
- * Expression - Parses and stores a tag pattern expression
66
- *
67
- * Patterns are parsed once and stored in an optimized structure for fast matching.
68
- *
69
- * @example
70
- * ```typescript
71
- * const expr = new Expression("root.users.user");
72
- * const expr2 = new Expression("..user[id]:first");
73
- * const expr3 = new Expression("root/users/user", { separator: '/' });
74
- * ```
75
- *
76
- * Pattern Syntax:
77
- * - `root.users.user` - Match exact path
78
- * - `..user` - Match "user" at any depth (deep wildcard)
79
- * - `user[id]` - Match user tag with "id" attribute
80
- * - `user[id=123]` - Match user tag where id="123"
81
- * - `user:first` - Match first occurrence of user tag
82
- * - `ns::user` - Match user tag with namespace "ns"
83
- * - `ns::user[id]:first` - Combine namespace, attribute, and position
84
- */
85
- export class Expression {
86
- /**
87
- * Original pattern string
88
- */
89
- readonly pattern: string;
90
-
91
- /**
92
- * Path separator character
93
- */
94
- readonly separator: string;
95
-
96
- /**
97
- * Parsed segments
98
- */
99
- readonly segments: Segment[];
100
-
101
- /**
102
- * Create a new Expression
103
- * @param pattern - Pattern string (e.g., "root.users.user", "..user[id]")
104
- * @param options - Configuration options
105
- */
106
- constructor(pattern: string, options?: ExpressionOptions);
107
-
108
- /**
109
- * Get the number of segments
110
- */
111
- get length(): number;
112
-
113
- /**
114
- * Check if expression contains deep wildcard (..)
115
- */
116
- hasDeepWildcard(): boolean;
117
-
118
- /**
119
- * Check if expression has attribute conditions
120
- */
121
- hasAttributeCondition(): boolean;
122
-
123
- /**
124
- * Check if expression has position selectors
125
- */
126
- hasPositionSelector(): boolean;
127
-
128
- /**
129
- * Get string representation
130
- */
131
- toString(): string;
132
- }
133
-
134
- /**
135
- * Options for creating a Matcher
136
- */
137
- export interface MatcherOptions {
138
- /**
139
- * Default path separator
140
- * @default '.'
141
- */
142
- separator?: string;
143
- }
144
-
145
- /**
146
- * Internal node structure in the path stack
147
- */
148
- export interface PathNode {
149
- /**
150
- * Tag name
151
- */
152
- tag: string;
153
-
154
- /**
155
- * Namespace (if present)
156
- */
157
- namespace?: string;
158
-
159
- /**
160
- * Position in sibling list (child index in parent)
161
- */
162
- position: number;
163
-
164
- /**
165
- * Counter (occurrence count of this tag name)
166
- */
167
- counter: number;
168
-
169
- /**
170
- * Attribute key-value pairs
171
- * Only present for the current (last) node in path
172
- */
173
- values?: Record<string, any>;
174
- }
175
-
176
- /**
177
- * Snapshot of matcher state
178
- */
179
- export interface MatcherSnapshot {
180
- /**
181
- * Copy of the path stack
182
- */
183
- path: PathNode[];
184
-
185
- /**
186
- * Copy of sibling tracking maps
187
- */
188
- siblingStacks: Map<string, number>[];
189
-
190
- /**
191
- * Copy of the kept-attrs stack (see {@link PushOptions.keep})
192
- */
193
- keptAttrs: KeptAttrEntry[];
194
- }
195
-
196
- /**
197
- * A single entry in the matcher's kept-attrs stack — an attribute value
198
- * explicitly retained at push time via `{ keep: [...] }` so it remains
199
- * reachable from descendants after the owning node is no longer current.
200
- */
201
- export interface KeptAttrEntry {
202
- /** Path depth (1-based) of the node that declared this kept attribute */
203
- depth: number;
204
- /** Attribute name */
205
- name: string;
206
- /** Attribute value at push time */
207
- value: any;
208
- }
209
-
210
- /**
211
- * Options for {@link Matcher#push}
212
- */
213
- export interface PushOptions {
214
- /**
215
- * Names of attributes (from `attrValues`) to retain for ancestor lookup
216
- * (`getAnyParentAttr` / `hasAnyParentAttr`) even after this node is no
217
- * longer the current node.
218
- *
219
- * Use sparingly — this is for attributes you know you'll need much deeper
220
- * in the tree (e.g. `xml:space`, a SOAP envelope's `version`), not a
221
- * general substitute for `getAttrValue()`. Cost is proportional to
222
- * `keep.length`, independent of path depth.
223
- */
224
- keep?: string[];
225
- }
226
-
227
- /**
228
- * MatcherView - A lightweight read-only view over a {@link Matcher} instance.
229
- *
230
- * Created once by {@link Matcher} and reused across all callbacks — no allocation
231
- * on every invocation. Holds a direct reference to the parent Matcher's internal
232
- * state so it always reflects the current parser position with zero copying or
233
- * freezing overhead.
234
- *
235
- * Mutation methods (`push`, `pop`, `reset`, `updateCurrent`, `restore`) are simply
236
- * absent from this class, so misuse is caught at compile time by TypeScript rather
237
- * than at runtime.
238
- *
239
- * Obtain via {@link Matcher#readOnly} — the same instance is returned every time.
240
- *
241
- * @example
242
- * ```typescript
243
- * const matcher = new Matcher();
244
- * const view: MatcherView = matcher.readOnly();
245
- *
246
- * matcher.push("root", {});
247
- * matcher.push("users", {});
248
- * matcher.push("user", { id: "123" });
249
- *
250
- * view.matches(expr); // ✓ true
251
- * view.getCurrentTag(); // ✓ "user"
252
- * view.getDepth(); // ✓ 3
253
- * // view.push(...) // ✗ Property 'push' does not exist on type 'MatcherView'
254
- * ```
255
- */
256
- export class MatcherView {
257
- /**
258
- * Default path separator (read-only, delegates to parent Matcher)
259
- */
260
- readonly separator: string;
261
-
262
- getCurrentTag(): string | undefined;
263
- getCurrentNamespace(): string | undefined;
264
- getAttrValue(attrName: string): any;
265
- hasAttr(attrName: string): boolean;
266
- /**
267
- * Get the value of a "kept" attribute from the nearest ancestor (or current
268
- * node) that declared it via `push(tag, attrs, ns, { keep: [...] })`.
269
- */
270
- getAnyParentAttr(attrName: string): any;
271
- /**
272
- * Check whether any ancestor (or the current node) kept the given
273
- * attribute via `push(tag, attrs, ns, { keep: [...] })`.
274
- */
275
- hasAnyParentAttr(attrName: string): boolean;
276
- getPosition(): number;
277
- getCounter(): number;
278
- /** @deprecated Use getPosition() or getCounter() instead */
279
- getIndex(): number;
280
- getDepth(): number;
281
- toString(separator?: string, includeNamespace?: boolean): string;
282
- toArray(): string[];
283
- matches(expression: Expression): boolean;
284
- matchesAny(exprSet: ExpressionSet): boolean;
285
- }
286
-
287
- /**
288
- * @deprecated Use {@link MatcherView} instead.
289
- * Alias kept for backward compatibility with code that references `ReadOnlyMatcher`.
290
- */
291
- export type ReadOnlyMatcher = MatcherView;
292
-
293
- /**
294
- * Matcher - Tracks current path in XML/JSON tree and matches against Expressions.
295
- *
296
- * The matcher maintains a stack of nodes representing the current path from root to
297
- * current tag. It only stores attribute values for the current (top) node to minimize
298
- * memory usage.
299
- *
300
- * Use {@link Matcher#readOnly} to obtain a {@link MatcherView} safe to pass to
301
- * user callbacks — the same instance is reused on every call with no allocation overhead.
302
- *
303
- * @example
304
- * ```typescript
305
- * const matcher = new Matcher();
306
- * matcher.push("root", {});
307
- * matcher.push("users", {});
308
- * matcher.push("user", { id: "123", type: "admin" });
309
- *
310
- * const expr = new Expression("root.users.user");
311
- * matcher.matches(expr); // true
312
- *
313
- * matcher.pop();
314
- * matcher.matches(expr); // false
315
- * ```
316
- */
317
- export class Matcher {
318
- /**
319
- * Default path separator
320
- */
321
- readonly separator: string;
322
-
323
- /**
324
- * Create a new Matcher
325
- * @param options - Configuration options
326
- */
327
- constructor(options?: MatcherOptions);
328
-
329
- /**
330
- * Push a new tag onto the path.
331
- * @param tagName - Name of the tag
332
- * @param attrValues - Attribute key-value pairs for current node (optional)
333
- * @param namespace - Namespace for the tag (optional)
334
- * @param options - Push options, e.g. `{ keep: ['version'] }` to retain
335
- * specific attributes for ancestor lookup after this node stops being current
336
- *
337
- * @example
338
- * ```typescript
339
- * matcher.push("user", { id: "123", type: "admin" });
340
- * matcher.push("user", { id: "456" }, "ns");
341
- * matcher.push("container", null);
342
- * matcher.push("Body", { version: "1.1" }, "soap", { keep: ["version"] });
343
- * ```
344
- */
345
- push(
346
- tagName: string,
347
- attrValues?: Record<string, any> | null,
348
- namespace?: string | null,
349
- options?: PushOptions | null
350
- ): void;
351
-
352
- /**
353
- * Pop the last tag from the path.
354
- * @returns The popped node or undefined if path is empty
355
- */
356
- pop(): PathNode | undefined;
357
-
358
- /**
359
- * Update current node's attribute values.
360
- * Useful when attributes are parsed after push.
361
- * @param attrValues - Attribute values
362
- */
363
- updateCurrent(attrValues: Record<string, any>): void;
364
-
365
- /**
366
- * Reset the path to empty.
367
- */
368
- reset(): void;
369
-
370
- /**
371
- * Create a snapshot of current state.
372
- * @returns State snapshot that can be restored later
373
- */
374
- snapshot(): MatcherSnapshot;
375
-
376
- /**
377
- * Restore state from snapshot.
378
- * @param snapshot - State snapshot from previous snapshot() call
379
- */
380
- restore(snapshot: MatcherSnapshot): void;
381
-
382
- getCurrentTag(): string | undefined;
383
- getCurrentNamespace(): string | undefined;
384
- getAttrValue(attrName: string): any;
385
- hasAttr(attrName: string): boolean;
386
- /**
387
- * Get the value of a "kept" attribute from the nearest ancestor (or current
388
- * node) that declared it via `push(tag, attrs, ns, { keep: [...] })`.
389
- * Cost is proportional to the number of currently-kept attributes, not
390
- * path depth.
391
- */
392
- getAnyParentAttr(attrName: string): any;
393
- /**
394
- * Check whether any ancestor (or the current node) kept the given
395
- * attribute via `push(tag, attrs, ns, { keep: [...] })`.
396
- */
397
- hasAnyParentAttr(attrName: string): boolean;
398
- getPosition(): number;
399
- getCounter(): number;
400
- /** @deprecated Use getPosition() or getCounter() instead */
401
- getIndex(): number;
402
- getDepth(): number;
403
- toString(separator?: string, includeNamespace?: boolean): string;
404
- toArray(): string[];
405
- matches(expression: Expression): boolean;
406
- matchesAny(exprSet: ExpressionSet): boolean;
407
-
408
- /**
409
- * Return the read-only {@link MatcherView} for this matcher.
410
- *
411
- * The same instance is returned on every call — no allocation occurs.
412
- * Pass this to user callbacks; it always reflects current parser state.
413
- *
414
- * @example
415
- * ```typescript
416
- * const view = matcher.readOnly();
417
- * // same reference every time — safe to cache
418
- * view === matcher.readOnly(); // true
419
- * ```
420
- */
421
- readOnly(): MatcherView;
422
- }
423
-
424
- /**
425
- * ExpressionSet - An indexed collection of Expressions for efficient bulk matching
426
- *
427
- * Pre-indexes expressions at insertion time by depth and terminal tag name so
428
- * that `matchesAny()` performs an O(1) bucket lookup rather than a full O(E)
429
- * linear scan on every tag.
430
- *
431
- * Three internal buckets are maintained automatically:
432
- * - **exact** — expressions with a fixed depth and a concrete terminal tag
433
- * - **depth-wildcard** — fixed depth but terminal tag is `*`
434
- * - **deep-wildcard** — expressions containing `..` (cannot be depth-indexed)
435
- *
436
- * @example
437
- * ```typescript
438
- * import { Expression, ExpressionSet, Matcher } from 'fast-xml-tagger';
439
- *
440
- * // Build once at config time
441
- * const stopNodes = new ExpressionSet();
442
- * stopNodes
443
- * .add(new Expression('root.users.user'))
444
- * .add(new Expression('root.config.*'))
445
- * .add(new Expression('..script'))
446
- * .seal(); // prevent accidental mutation during parsing
447
- *
448
- * // Query on every tag — hot path
449
- * if (stopNodes.matchesAny(matcher)) {
450
- * // handle stop node
451
- * }
452
- * ```
453
- */
454
- export class ExpressionSet {
455
- /**
456
- * Create an empty ExpressionSet.
457
- */
458
- constructor();
459
-
460
- /**
461
- * Number of expressions currently in the set.
462
- */
463
- readonly size: number;
464
-
465
- /**
466
- * Whether the set has been sealed against further modifications.
467
- */
468
- readonly isSealed: boolean;
469
-
470
- /**
471
- * Add a single Expression to the set.
472
- *
473
- * Duplicate patterns (same `expression.pattern` string) are silently ignored.
474
- *
475
- * @param expression - A pre-constructed Expression instance
476
- * @returns `this` — for chaining
477
- * @throws {TypeError} if the set has been sealed
478
- *
479
- * @example
480
- * ```typescript
481
- * set.add(new Expression('root.users.user'));
482
- * set.add(new Expression('..script'));
483
- * ```
484
- */
485
- add(expression: Expression): this;
486
-
487
- /**
488
- * Add multiple expressions at once.
489
- *
490
- * @param expressions - Array of Expression instances
491
- * @returns `this` — for chaining
492
- * @throws {TypeError} if the set has been sealed
493
- *
494
- * @example
495
- * ```typescript
496
- * set.addAll([
497
- * new Expression('root.users.user'),
498
- * new Expression('root.config.setting'),
499
- * ]);
500
- * ```
501
- */
502
- addAll(expressions: Expression[]): this;
503
-
504
- /**
505
- * Check whether an Expression with the same pattern is already present.
506
- *
507
- * @param expression - Expression to look up
508
- * @returns `true` if the pattern was already added
509
- */
510
- has(expression: Expression): boolean;
511
-
512
- /**
513
- * Seal the set against further modifications.
514
- *
515
- * After calling `seal()`, any call to `add()` or `addAll()` will throw a
516
- * `TypeError`. This is useful to prevent accidental mutation once the config
517
- * has been fully built and parsing has started.
518
- *
519
- * @returns `this` — for chaining
520
- *
521
- * @example
522
- * ```typescript
523
- * const stopNodes = new ExpressionSet();
524
- * stopNodes.addAll(patterns.map(p => new Expression(p))).seal();
525
- *
526
- * // Later — safe: reads are still allowed
527
- * stopNodes.matchesAny(matcher);
528
- *
529
- * // Later — throws TypeError: ExpressionSet is sealed
530
- * stopNodes.add(new Expression('root.extra'));
531
- * ```
532
- */
533
- seal(): this;
534
-
535
- /**
536
- * Test whether the matcher's current path matches **any** expression in the set.
537
- *
538
- * Uses the pre-built index to evaluate only the relevant bucket(s):
539
- * 1. Exact depth + tag — O(1) lookup
540
- * 2. Depth-matched wildcard tag — O(1) lookup
541
- * 3. Deep-wildcard expressions — always scanned (typically a small list)
542
- *
543
- * @param matcher - A `Matcher` instance or a `ReadOnlyMatcher` view
544
- * @returns `true` if at least one expression matches the current path
545
- *
546
- * @example
547
- * ```typescript
548
- * // Replaces:
549
- * // for (const expr of stopNodeExpressions) {
550
- * // if (matcher.matches(expr)) return true;
551
- * // }
552
- *
553
- * if (stopNodes.matchesAny(matcher)) {
554
- * // current tag is a stop node
555
- * }
556
- * ```
557
- */
558
- matchesAny(matcher: Matcher | MatcherView): boolean;
559
-
560
- /**
561
- * Find the first expression in the set that matches the matcher's current path.
562
- *
563
- * Uses the pre-built index to evaluate only the relevant bucket(s):
564
- * 1. Exact depth + tag — O(1) lookup
565
- * 2. Depth-matched wildcard tag — O(1) lookup
566
- * 3. Deep-wildcard expressions — always scanned (typically a small list)
567
- *
568
- * @param matcher - A `Matcher` instance or a `ReadOnlyMatcher` view
569
- * @returns Expression if at least one expression matches the current path
570
- *
571
- * @example
572
- * ```typescript
573
- * const node = stopNodes.findMatch(matcher);
574
- * ```
575
- */
576
- findMatch(matcher: Matcher | MatcherView): Expression;
577
- }
578
-
579
- /**
580
- * Default export containing Expression, Matcher, and ExpressionSet
581
- */
582
- declare const _default: {
583
- Expression: typeof Expression;
584
- Matcher: typeof Matcher;
585
- MatcherView: typeof MatcherView;
586
- ExpressionSet: typeof ExpressionSet;
587
- };
588
-
589
- export default _default;
@@ -1,29 +0,0 @@
1
- /**
2
- * fast-xml-tagger - XML/JSON path matching library
3
- *
4
- * Provides efficient path tracking and pattern matching for XML/JSON parsers.
5
- *
6
- * @example
7
- * import { Expression, Matcher } from 'fast-xml-tagger';
8
- *
9
- * // Create expression (parse once)
10
- * const expr = new Expression("root.users.user[id]");
11
- *
12
- * // Create matcher (track path)
13
- * const matcher = new Matcher();
14
- * matcher.push("root", [], {}, 0);
15
- * matcher.push("users", [], {}, 0);
16
- * matcher.push("user", ["id", "type"], { id: "123", type: "admin" }, 0);
17
- *
18
- * // Match
19
- * if (matcher.matches(expr)) {
20
- * console.log("Match found!");
21
- * }
22
- */
23
-
24
- import Expression from './Expression.js';
25
- import Matcher from './Matcher.js';
26
- import ExpressionSet from './ExpressionSet.js';
27
-
28
- export { Expression, Matcher, ExpressionSet };
29
- export default { Expression, Matcher, ExpressionSet };
@@ -1,51 +0,0 @@
1
-
2
- **2.4.0 / 2026-06-09**
3
- - support unicode numerals using 'anynum'
4
-
5
- **2.3.0 / 2026-05-07**
6
- - support octal and binary, test with @byspec/numbers
7
- - test with @byspec/numbers
8
-
9
-
10
- **2.2.3 / 2026-04-07**
11
- - remove unnecessary files from npm package
12
-
13
- **2.2.2 / 2026-03-23**
14
- - fix for space string
15
-
16
-
17
- **2.2.1 / 2026-03-19**
18
- - fix false positive for eNotation when no leading zeros
19
-
20
- **2.2.0 / 2026-02-28**
21
- - support infinity
22
-
23
- **2.1.0 / 2025-05-01**
24
- - fix e-notation
25
- - to return string when invalid enotation is found. Eg `E24`
26
- - to return valid number when only leading zero before e char is present
27
-
28
- **2.0.5 / 2025-02-27**
29
- - changes done in 1.1.2
30
-
31
- **1.1.2 / 2025-02-27**
32
- - fix skiplike for 0
33
-
34
- **1.1.1 / 2025-02-21**
35
- - All recent fixes of version 2
36
-
37
- **2.0.4 / 2025-02-20**
38
- - remove console log
39
-
40
- **2.0.3 / 2025-02-20**
41
- - fix for string which are falsly identified as e-notation
42
-
43
- **2.0.1 / 2025-02-20**
44
- - fix: handle only zeros
45
- - fix: return original string when NaN
46
-
47
- **2.0.0 / 2025-02-20**
48
- - Migrating to ESM modules. No functional change
49
-
50
- **1.1.0 / 2025-02-20**
51
- - fix (#9): support missing floating point and e notations
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2021 Natural Intelligence
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.