@btc-embedded/cdk-extensions 0.23.3 → 0.23.5

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 (135) hide show
  1. package/.jsii +41 -41
  2. package/CHANGELOG.md +14 -0
  3. package/assets/cli/catnip.js +154 -166
  4. package/lib/constructs/EventPipe.js +1 -1
  5. package/lib/constructs/ExportedService.js +1 -1
  6. package/lib/constructs/S3Bucket.js +1 -1
  7. package/lib/constructs/SecureRestApi.js +1 -1
  8. package/lib/constructs/SecureRestApiV2.js +1 -1
  9. package/lib/constructs/api-keys/ApiKeyClientAuthorization.js +1 -1
  10. package/lib/constructs/api-keys/ApiKeyManagement.js +1 -1
  11. package/lib/constructs/api-keys/ApiKeyPreTokenHandler.js +1 -1
  12. package/lib/constructs/api-keys/ApiKeyStore.js +1 -1
  13. package/lib/extensions/ApiGatewayExtension.js +1 -1
  14. package/lib/extensions/ApplicationContainer.js +1 -1
  15. package/lib/extensions/ApplicationLoadBalancerExtension.js +1 -1
  16. package/lib/extensions/ApplicationLoadBalancerExtensionV2.js +1 -1
  17. package/lib/extensions/CloudMapExtension.js +1 -1
  18. package/lib/extensions/DeactivatableServiceExtension.js +1 -1
  19. package/lib/extensions/DeploymentConfigExtension.js +1 -1
  20. package/lib/extensions/DocumentDbAccessExtension.js +1 -1
  21. package/lib/extensions/DomainEventMessagingExtension.js +1 -1
  22. package/lib/extensions/EfsMountExtension.js +1 -1
  23. package/lib/extensions/ExtraContainerExtension.js +1 -1
  24. package/lib/extensions/HTTPApiExtension.js +1 -1
  25. package/lib/extensions/LogExtension.js +1 -1
  26. package/lib/extensions/ModifyContainerDefinitionExtension.js +1 -1
  27. package/lib/extensions/ModifyTaskDefinitionExtension.js +1 -1
  28. package/lib/extensions/OpenIdExtension.js +1 -1
  29. package/lib/extensions/OpenTelemetryExtension.js +1 -1
  30. package/lib/extensions/PostgresDbAccessExtension.js +1 -1
  31. package/lib/extensions/SharedVolumeExtension.js +1 -1
  32. package/lib/extensions/TcpKeepAliveExtension.js +1 -1
  33. package/lib/platform/ApiGateway.js +1 -1
  34. package/lib/platform/ApiGatewayVpcLink.js +2 -2
  35. package/lib/platform/ApplicationLoadBalancer.js +1 -1
  36. package/lib/platform/ApplicationLoadBalancerV2.d.ts +1 -0
  37. package/lib/platform/ApplicationLoadBalancerV2.js +10 -3
  38. package/lib/platform/AuroraPostgresDB.js +5 -4
  39. package/lib/platform/BTCLogGroup.js +1 -1
  40. package/lib/platform/CognitoUserPool.js +2 -2
  41. package/lib/platform/DefaultUserPoolClients.js +1 -1
  42. package/lib/platform/DocumentDB.js +2 -2
  43. package/lib/platform/EcsCluster.js +1 -1
  44. package/lib/platform/EfsFileSystem.js +1 -1
  45. package/lib/platform/HostedZone.js +1 -1
  46. package/lib/platform/PrivateDnsNamespace.js +1 -1
  47. package/lib/platform/ResourceServer.js +1 -1
  48. package/lib/platform/Vpc.js +1 -1
  49. package/lib/platform/VpcV2.js +1 -1
  50. package/lib/stacks/ApplicationStack.js +1 -1
  51. package/lib/utils/BasePlatformStackResolver.js +1 -1
  52. package/lib/utils/StackParameter.js +1 -1
  53. package/node_modules/@nodable/entities/README.md +41 -0
  54. package/node_modules/@nodable/entities/package.json +54 -0
  55. package/node_modules/@nodable/entities/src/EntityDecoder.js +543 -0
  56. package/node_modules/@nodable/entities/src/EntityEncoder.js +194 -0
  57. package/node_modules/@nodable/entities/src/entities.js +1177 -0
  58. package/node_modules/@nodable/entities/src/entityTries.js +49 -0
  59. package/node_modules/@nodable/entities/src/index.d.ts +264 -0
  60. package/node_modules/@nodable/entities/src/index.js +29 -0
  61. package/node_modules/fast-xml-builder/CHANGELOG.md +40 -0
  62. package/node_modules/fast-xml-builder/LICENSE +21 -0
  63. package/node_modules/fast-xml-builder/README.md +74 -0
  64. package/node_modules/fast-xml-builder/lib/fxb.cjs +1 -0
  65. package/node_modules/fast-xml-builder/lib/fxb.d.cts +270 -0
  66. package/node_modules/fast-xml-builder/lib/fxb.min.js +2 -0
  67. package/node_modules/fast-xml-builder/lib/fxb.min.js.map +1 -0
  68. package/node_modules/fast-xml-builder/package.json +81 -0
  69. package/node_modules/fast-xml-builder/src/fxb.d.ts +270 -0
  70. package/node_modules/fast-xml-builder/src/fxb.js +599 -0
  71. package/node_modules/fast-xml-builder/src/ignoreAttributes.js +18 -0
  72. package/node_modules/fast-xml-builder/src/orderedJs2Xml.js +359 -0
  73. package/node_modules/fast-xml-builder/src/util.js +16 -0
  74. package/node_modules/fast-xml-parser/CHANGELOG.md +165 -0
  75. package/node_modules/fast-xml-parser/README.md +21 -44
  76. package/node_modules/fast-xml-parser/lib/fxbuilder.min.js +1 -1
  77. package/node_modules/fast-xml-parser/lib/fxbuilder.min.js.map +1 -1
  78. package/node_modules/fast-xml-parser/lib/fxp.cjs +1 -1
  79. package/node_modules/fast-xml-parser/lib/fxp.d.cts +343 -31
  80. package/node_modules/fast-xml-parser/lib/fxp.min.js +1 -1
  81. package/node_modules/fast-xml-parser/lib/fxp.min.js.map +1 -1
  82. package/node_modules/fast-xml-parser/lib/fxparser.min.js +1 -1
  83. package/node_modules/fast-xml-parser/lib/fxparser.min.js.map +1 -1
  84. package/node_modules/fast-xml-parser/lib/fxvalidator.min.js +1 -1
  85. package/node_modules/fast-xml-parser/lib/fxvalidator.min.js.map +1 -1
  86. package/node_modules/fast-xml-parser/package.json +13 -8
  87. package/node_modules/fast-xml-parser/src/fxp.d.ts +335 -30
  88. package/node_modules/fast-xml-parser/src/fxp.js +1 -1
  89. package/node_modules/fast-xml-parser/src/util.js +18 -25
  90. package/node_modules/fast-xml-parser/src/v6/EntitiesParser.js +89 -87
  91. package/node_modules/fast-xml-parser/src/v6/OptionsBuilder.js +10 -10
  92. package/node_modules/fast-xml-parser/src/v6/OutputBuilders/BaseOutputBuilder.js +23 -23
  93. package/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsArrBuilder.js +29 -29
  94. package/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsMinArrBuilder.js +1 -1
  95. package/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsObjBuilder.js +39 -39
  96. package/node_modules/fast-xml-parser/src/v6/OutputBuilders/ParserOptionsBuilder.js +21 -21
  97. package/node_modules/fast-xml-parser/src/v6/XMLParser.js +22 -22
  98. package/node_modules/fast-xml-parser/src/v6/valueParsers/EntitiesParser.js +85 -85
  99. package/node_modules/fast-xml-parser/src/validator.js +34 -34
  100. package/node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js +5 -284
  101. package/node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js +335 -293
  102. package/node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js +160 -43
  103. package/node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js +540 -308
  104. package/node_modules/fast-xml-parser/src/xmlparser/XMLParser.js +26 -26
  105. package/node_modules/fast-xml-parser/src/xmlparser/node2json.js +99 -41
  106. package/node_modules/fast-xml-parser/src/xmlparser/xmlNode.js +10 -10
  107. package/node_modules/path-expression-matcher/LICENSE +21 -0
  108. package/node_modules/path-expression-matcher/README.md +872 -0
  109. package/node_modules/path-expression-matcher/lib/pem.cjs +1 -0
  110. package/node_modules/path-expression-matcher/lib/pem.d.cts +634 -0
  111. package/node_modules/path-expression-matcher/lib/pem.min.js +2 -0
  112. package/node_modules/path-expression-matcher/lib/pem.min.js.map +1 -0
  113. package/node_modules/path-expression-matcher/package.json +78 -0
  114. package/node_modules/path-expression-matcher/src/Expression.js +232 -0
  115. package/node_modules/path-expression-matcher/src/ExpressionSet.js +209 -0
  116. package/node_modules/path-expression-matcher/src/Matcher.js +570 -0
  117. package/node_modules/path-expression-matcher/src/index.d.ts +523 -0
  118. package/node_modules/path-expression-matcher/src/index.js +29 -0
  119. package/node_modules/strnum/CHANGELOG.md +12 -2
  120. package/node_modules/strnum/README.md +1 -0
  121. package/node_modules/strnum/package.json +5 -4
  122. package/node_modules/strnum/strnum.js +99 -65
  123. package/node_modules/xml-naming/README.md +189 -0
  124. package/node_modules/xml-naming/package.json +54 -0
  125. package/node_modules/xml-naming/src/index.d.ts +74 -0
  126. package/node_modules/xml-naming/src/index.js +270 -0
  127. package/package.json +3 -2
  128. package/renovate.json5 +1 -0
  129. package/node_modules/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js +0 -134
  130. package/node_modules/strnum/.github/SECURITY.md +0 -5
  131. package/node_modules/strnum/.vscode/launch.json +0 -25
  132. package/node_modules/strnum/algo.stflow +0 -84
  133. package/node_modules/strnum/strnum.test.js +0 -173
  134. package/node_modules/strnum/test.js +0 -9
  135. /package/node_modules/{fast-xml-parser/src/xmlbuilder → fast-xml-builder/src}/prettifyJs2Xml.js +0 -0
@@ -0,0 +1 @@
1
+ (()=>{"use strict";var t={d:(e,s)=>{for(var i in s)t.o(s,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:s[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{Expression:()=>s,ExpressionSet:()=>n,Matcher:()=>h,default:()=>r});class s{constructor(t,e={},s){this.pattern=t,this.separator=e.separator||".",this.segments=this._parse(t),this.data=s,this._hasDeepWildcard=this.segments.some(t=>"deep-wildcard"===t.type),this._hasAttributeCondition=this.segments.some(t=>void 0!==t.attrName),this._hasPositionSelector=this.segments.some(t=>void 0!==t.position)}_parse(t){const e=[];let s=0,i="";for(;s<t.length;)t[s]===this.separator?s+1<t.length&&t[s+1]===this.separator?(i.trim()&&(e.push(this._parseSegment(i.trim())),i=""),e.push({type:"deep-wildcard"}),s+=2):(i.trim()&&e.push(this._parseSegment(i.trim())),i="",s++):(i+=t[s],s++);return i.trim()&&e.push(this._parseSegment(i.trim())),e}_parseSegment(t){const e={type:"tag"};let s=null,i=t;const h=t.match(/^([^\[]+)(\[[^\]]*\])(.*)$/);if(h&&(i=h[1]+h[3],h[2])){const t=h[2].slice(1,-1);t&&(s=t)}let n,r,a=i;if(i.includes("::")){const e=i.indexOf("::");if(n=i.substring(0,e).trim(),a=i.substring(e+2).trim(),!n)throw new Error(`Invalid namespace in pattern: ${t}`)}let p=null;if(a.includes(":")){const t=a.lastIndexOf(":"),e=a.substring(0,t).trim(),s=a.substring(t+1).trim();["first","last","odd","even"].includes(s)||/^nth\(\d+\)$/.test(s)?(r=e,p=s):r=a}else r=a;if(!r)throw new Error(`Invalid segment pattern: ${t}`);if(e.tag=r,n&&(e.namespace=n),s)if(s.includes("=")){const t=s.indexOf("=");e.attrName=s.substring(0,t).trim(),e.attrValue=s.substring(t+1).trim()}else e.attrName=s.trim();if(p){const t=p.match(/^nth\((\d+)\)$/);t?(e.position="nth",e.positionValue=parseInt(t[1],10)):e.position=p}return e}get length(){return this.segments.length}hasDeepWildcard(){return this._hasDeepWildcard}hasAttributeCondition(){return this._hasAttributeCondition}hasPositionSelector(){return this._hasPositionSelector}toString(){return this.pattern}}class i{constructor(t){this._matcher=t}get separator(){return this._matcher.separator}getCurrentTag(){const t=this._matcher.path;return t.length>0?t[t.length-1].tag:void 0}getCurrentNamespace(){const t=this._matcher.path;return t.length>0?t[t.length-1].namespace:void 0}getAttrValue(t){const e=this._matcher.path;if(0!==e.length)return e[e.length-1].values?.[t]}hasAttr(t){const e=this._matcher.path;if(0===e.length)return!1;const s=e[e.length-1];return void 0!==s.values&&t in s.values}getPosition(){const t=this._matcher.path;return 0===t.length?-1:t[t.length-1].position??0}getCounter(){const t=this._matcher.path;return 0===t.length?-1:t[t.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this._matcher.path.length}toString(t,e=!0){return this._matcher.toString(t,e)}toArray(){return this._matcher.path.map(t=>t.tag)}matches(t){return this._matcher.matches(t)}matchesAny(t){return t.matchesAny(this._matcher)}}class h{constructor(t={}){this.separator=t.separator||".",this.path=[],this.siblingStacks=[],this._pathStringCache=null,this._view=new i(this)}push(t,e=null,s=null){this._pathStringCache=null,this.path.length>0&&(this.path[this.path.length-1].values=void 0);const i=this.path.length;this.siblingStacks[i]||(this.siblingStacks[i]=new Map);const h=this.siblingStacks[i],n=s?`${s}:${t}`:t,r=h.get(n)||0;let a=0;for(const t of h.values())a+=t;h.set(n,r+1);const p={tag:t,position:a,counter:r};null!=s&&(p.namespace=s),null!=e&&(p.values=e),this.path.push(p)}pop(){if(0===this.path.length)return;this._pathStringCache=null;const t=this.path.pop();return this.siblingStacks.length>this.path.length+1&&(this.siblingStacks.length=this.path.length+1),t}updateCurrent(t){if(this.path.length>0){const e=this.path[this.path.length-1];null!=t&&(e.values=t)}}getCurrentTag(){return this.path.length>0?this.path[this.path.length-1].tag:void 0}getCurrentNamespace(){return this.path.length>0?this.path[this.path.length-1].namespace:void 0}getAttrValue(t){if(0!==this.path.length)return this.path[this.path.length-1].values?.[t]}hasAttr(t){if(0===this.path.length)return!1;const e=this.path[this.path.length-1];return void 0!==e.values&&t in e.values}getPosition(){return 0===this.path.length?-1:this.path[this.path.length-1].position??0}getCounter(){return 0===this.path.length?-1:this.path[this.path.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this.path.length}toString(t,e=!0){const s=t||this.separator;if(s===this.separator&&!0===e){if(null!==this._pathStringCache)return this._pathStringCache;const t=this.path.map(t=>t.namespace?`${t.namespace}:${t.tag}`:t.tag).join(s);return this._pathStringCache=t,t}return this.path.map(t=>e&&t.namespace?`${t.namespace}:${t.tag}`:t.tag).join(s)}toArray(){return this.path.map(t=>t.tag)}reset(){this._pathStringCache=null,this.path=[],this.siblingStacks=[]}matches(t){const e=t.segments;return 0!==e.length&&(t.hasDeepWildcard()?this._matchWithDeepWildcard(e):this._matchSimple(e))}_matchSimple(t){if(this.path.length!==t.length)return!1;for(let e=0;e<t.length;e++)if(!this._matchSegment(t[e],this.path[e],e===this.path.length-1))return!1;return!0}_matchWithDeepWildcard(t){let e=this.path.length-1,s=t.length-1;for(;s>=0&&e>=0;){const i=t[s];if("deep-wildcard"===i.type){if(s--,s<0)return!0;const i=t[s];let h=!1;for(let t=e;t>=0;t--)if(this._matchSegment(i,this.path[t],t===this.path.length-1)){e=t-1,s--,h=!0;break}if(!h)return!1}else{if(!this._matchSegment(i,this.path[e],e===this.path.length-1))return!1;e--,s--}}return s<0}_matchSegment(t,e,s){if("*"!==t.tag&&t.tag!==e.tag)return!1;if(void 0!==t.namespace&&"*"!==t.namespace&&t.namespace!==e.namespace)return!1;if(void 0!==t.attrName){if(!s)return!1;if(!e.values||!(t.attrName in e.values))return!1;if(void 0!==t.attrValue&&String(e.values[t.attrName])!==String(t.attrValue))return!1}if(void 0!==t.position){if(!s)return!1;const i=e.counter??0;if("first"===t.position&&0!==i)return!1;if("odd"===t.position&&i%2!=1)return!1;if("even"===t.position&&i%2!=0)return!1;if("nth"===t.position&&i!==t.positionValue)return!1}return!0}matchesAny(t){return t.matchesAny(this)}snapshot(){return{path:this.path.map(t=>({...t})),siblingStacks:this.siblingStacks.map(t=>new Map(t))}}restore(t){this._pathStringCache=null,this.path=t.path.map(t=>({...t})),this.siblingStacks=t.siblingStacks.map(t=>new Map(t))}readOnly(){return this._view}}class n{constructor(){this._byDepthAndTag=new Map,this._wildcardByDepth=new Map,this._deepWildcards=[],this._patterns=new Set,this._sealed=!1}add(t){if(this._sealed)throw new TypeError("ExpressionSet is sealed. Create a new ExpressionSet to add more expressions.");if(this._patterns.has(t.pattern))return this;if(this._patterns.add(t.pattern),t.hasDeepWildcard())return this._deepWildcards.push(t),this;const e=t.length,s=t.segments[t.segments.length-1],i=s?.tag;if(i&&"*"!==i){const s=`${e}:${i}`;this._byDepthAndTag.has(s)||this._byDepthAndTag.set(s,[]),this._byDepthAndTag.get(s).push(t)}else this._wildcardByDepth.has(e)||this._wildcardByDepth.set(e,[]),this._wildcardByDepth.get(e).push(t);return this}addAll(t){for(const e of t)this.add(e);return this}has(t){return this._patterns.has(t.pattern)}get size(){return this._patterns.size}seal(){return this._sealed=!0,this}get isSealed(){return this._sealed}matchesAny(t){return null!==this.findMatch(t)}findMatch(t){const e=t.getDepth(),s=`${e}:${t.getCurrentTag()}`,i=this._byDepthAndTag.get(s);if(i)for(let e=0;e<i.length;e++)if(t.matches(i[e]))return i[e];const h=this._wildcardByDepth.get(e);if(h)for(let e=0;e<h.length;e++)if(t.matches(h[e]))return h[e];for(let e=0;e<this._deepWildcards.length;e++)if(t.matches(this._deepWildcards[e]))return this._deepWildcards[e];return null}}const r={Expression:s,Matcher:h,ExpressionSet:n};module.exports=e})();
@@ -0,0 +1,634 @@
1
+ /**
2
+ * TypeScript definitions for path-expression-matcher (CommonJS)
3
+ */
4
+
5
+ /**
6
+ * Options for creating an Expression
7
+ */
8
+ declare interface ExpressionOptions {
9
+ /**
10
+ * Path separator character
11
+ * @default '.'
12
+ */
13
+ separator?: string;
14
+ }
15
+
16
+ /**
17
+ * Parsed segment from an expression pattern
18
+ */
19
+ declare interface Segment {
20
+ /**
21
+ * Type of segment
22
+ */
23
+ type: 'tag' | 'deep-wildcard';
24
+
25
+ /**
26
+ * Tag name (e.g., "user", "*" for wildcard)
27
+ * Only present when type is 'tag'
28
+ */
29
+ tag?: string;
30
+
31
+ /**
32
+ * Namespace prefix (e.g., "ns" in "ns::user")
33
+ * Only present when namespace is specified
34
+ */
35
+ namespace?: string;
36
+
37
+ /**
38
+ * Attribute name to match (e.g., "id" in "user[id]")
39
+ * Only present when attribute condition exists
40
+ */
41
+ attrName?: string;
42
+
43
+ /**
44
+ * Attribute value to match (e.g., "123" in "user[id=123]")
45
+ * Only present when attribute value is specified
46
+ */
47
+ attrValue?: string;
48
+
49
+ /**
50
+ * Position selector type
51
+ * Only present when position selector exists
52
+ */
53
+ position?: 'first' | 'last' | 'odd' | 'even' | 'nth';
54
+
55
+ /**
56
+ * Numeric value for nth() selector
57
+ * Only present when position is 'nth'
58
+ */
59
+ positionValue?: number;
60
+ }
61
+
62
+ /**
63
+ * Expression - Parses and stores a tag pattern expression
64
+ *
65
+ * Patterns are parsed once and stored in an optimized structure for fast matching.
66
+ *
67
+ * @example
68
+ * ```javascript
69
+ * const { Expression } = require('path-expression-matcher');
70
+ * const expr = new Expression("root.users.user");
71
+ * const expr2 = new Expression("..user[id]:first");
72
+ * const expr3 = new Expression("root/users/user", { separator: '/' });
73
+ * ```
74
+ *
75
+ * Pattern Syntax:
76
+ * - `root.users.user` - Match exact path
77
+ * - `..user` - Match "user" at any depth (deep wildcard)
78
+ * - `user[id]` - Match user tag with "id" attribute
79
+ * - `user[id=123]` - Match user tag where id="123"
80
+ * - `user:first` - Match first occurrence of user tag
81
+ * - `ns::user` - Match user tag with namespace "ns"
82
+ * - `ns::user[id]:first` - Combine namespace, attribute, and position
83
+ * ```
84
+ */
85
+ declare 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
+ declare 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
+ declare 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
+ declare 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
+ /**
192
+ * ReadOnlyMatcher - A safe, read-only view over a {@link Matcher} instance.
193
+ *
194
+ * Returned by {@link Matcher.readOnly}. Exposes all query and inspection
195
+ * methods but **throws a `TypeError`** if any state-mutating method is called
196
+ * (`push`, `pop`, `reset`, `updateCurrent`, `restore`). Direct property
197
+ * writes are also blocked.
198
+ *
199
+ * Pass this to consumers that only need to inspect or match the current path
200
+ * so they cannot accidentally corrupt the parser state.
201
+ *
202
+ * @example
203
+ * ```javascript
204
+ * const matcher = new Matcher();
205
+ * matcher.push("root", {});
206
+ * matcher.push("users", {});
207
+ * matcher.push("user", { id: "123" });
208
+ *
209
+ * const ro: ReadOnlyMatcher = matcher.readOnly();
210
+ *
211
+ * ro.matches(expr); // ✓ works
212
+ * ro.getCurrentTag(); // ✓ "user"
213
+ * ro.getDepth(); // ✓ 3
214
+ * ro.push("child", {}); // ✗ TypeError: Cannot call 'push' on a read-only Matcher
215
+ * ro.reset(); // ✗ TypeError: Cannot call 'reset' on a read-only Matcher
216
+ * ```
217
+ */
218
+ declare interface ReadOnlyMatcher {
219
+ /**
220
+ * Default path separator (read-only)
221
+ */
222
+ readonly separator: string;
223
+
224
+ /**
225
+ * Current path stack (each node is a frozen copy)
226
+ */
227
+ readonly path: ReadonlyArray<Readonly<PathNode>>;
228
+
229
+ // ── Query methods ───────────────────────────────────────────────────────────
230
+
231
+ /**
232
+ * Get current tag name
233
+ * @returns Current tag name or undefined if path is empty
234
+ */
235
+ getCurrentTag(): string | undefined;
236
+
237
+ /**
238
+ * Get current namespace
239
+ * @returns Current namespace or undefined if not present or path is empty
240
+ */
241
+ getCurrentNamespace(): string | undefined;
242
+
243
+ /**
244
+ * Get current node's attribute value
245
+ * @param attrName - Attribute name
246
+ * @returns Attribute value or undefined
247
+ */
248
+ getAttrValue(attrName: string): any;
249
+
250
+ /**
251
+ * Check if current node has an attribute
252
+ * @param attrName - Attribute name
253
+ */
254
+ hasAttr(attrName: string): boolean;
255
+
256
+ /**
257
+ * Get current node's sibling position (child index in parent)
258
+ * @returns Position index or -1 if path is empty
259
+ */
260
+ getPosition(): number;
261
+
262
+ /**
263
+ * Get current node's repeat counter (occurrence count of this tag name)
264
+ * @returns Counter value or -1 if path is empty
265
+ */
266
+ getCounter(): number;
267
+
268
+ /**
269
+ * Get current node's sibling index (alias for getPosition for backward compatibility)
270
+ * @returns Index or -1 if path is empty
271
+ * @deprecated Use getPosition() or getCounter() instead
272
+ */
273
+ getIndex(): number;
274
+
275
+ /**
276
+ * Get current path depth
277
+ * @returns Number of nodes in the path
278
+ */
279
+ getDepth(): number;
280
+
281
+ /**
282
+ * Get path as string
283
+ * @param separator - Optional separator (uses default if not provided)
284
+ * @param includeNamespace - Whether to include namespace in output
285
+ * @returns Path string (e.g., "root.users.user" or "ns:root.ns:users.user")
286
+ */
287
+ toString(separator?: string, includeNamespace?: boolean): string;
288
+
289
+ /**
290
+ * Get path as array of tag names
291
+ * @returns Array of tag names
292
+ */
293
+ toArray(): string[];
294
+
295
+ /**
296
+ * Match current path against an Expression
297
+ * @param expression - The expression to match against
298
+ * @returns True if current path matches the expression
299
+ */
300
+ matches(expression: Expression): boolean;
301
+
302
+ /**
303
+ * Test whether the matcher's current path matches **any** expression in the set.
304
+ *
305
+ * @param exprSet - A `ExpressionSet` instance
306
+ * @returns `true` if at least one expression matches the current path
307
+ */
308
+ matchesAny(exprSet: ExpressionSet): boolean;
309
+ /**
310
+ * Create a snapshot of current state
311
+ * @returns State snapshot that can be restored later
312
+ */
313
+ snapshot(): MatcherSnapshot;
314
+
315
+ // ── Blocked mutating methods ────────────────────────────────────────────────
316
+ // These are present in the type so callers get a compile-time error with a
317
+ // helpful message instead of a silent "property does not exist" error.
318
+
319
+ /**
320
+ * @throws {TypeError} Always – mutation is not allowed on a read-only view.
321
+ */
322
+ push(tagName: string, attrValues?: Record<string, any> | null, namespace?: string | null): never;
323
+
324
+ /**
325
+ * @throws {TypeError} Always – mutation is not allowed on a read-only view.
326
+ */
327
+ pop(): never;
328
+
329
+ /**
330
+ * @throws {TypeError} Always – mutation is not allowed on a read-only view.
331
+ */
332
+ updateCurrent(attrValues: Record<string, any>): never;
333
+
334
+ /**
335
+ * @throws {TypeError} Always – mutation is not allowed on a read-only view.
336
+ */
337
+ reset(): never;
338
+
339
+ /**
340
+ * @throws {TypeError} Always – mutation is not allowed on a read-only view.
341
+ */
342
+ restore(snapshot: MatcherSnapshot): never;
343
+ }
344
+
345
+ /**
346
+ * Matcher - Tracks current path in XML/JSON tree and matches against Expressions
347
+ *
348
+ * The matcher maintains a stack of nodes representing the current path from root to
349
+ * current tag. It only stores attribute values for the current (top) node to minimize
350
+ * memory usage.
351
+ *
352
+ * @example
353
+ * ```javascript
354
+ * const { Matcher } = require('path-expression-matcher');
355
+ * const matcher = new Matcher();
356
+ * matcher.push("root", {});
357
+ * matcher.push("users", {});
358
+ * matcher.push("user", { id: "123", type: "admin" });
359
+ *
360
+ * const expr = new Expression("root.users.user");
361
+ * matcher.matches(expr); // true
362
+ *
363
+ * matcher.pop();
364
+ * matcher.matches(expr); // false
365
+ * ```
366
+ */
367
+ declare class Matcher {
368
+ /**
369
+ * Default path separator
370
+ */
371
+ readonly separator: string;
372
+
373
+ /**
374
+ * Current path stack
375
+ */
376
+ readonly path: PathNode[];
377
+
378
+ /**
379
+ * Create a new Matcher
380
+ * @param options - Configuration options
381
+ */
382
+ constructor(options?: MatcherOptions);
383
+
384
+ /**
385
+ * Push a new tag onto the path
386
+ * @param tagName - Name of the tag
387
+ * @param attrValues - Attribute key-value pairs for current node (optional)
388
+ * @param namespace - Namespace for the tag (optional)
389
+ *
390
+ * @example
391
+ * ```javascript
392
+ * matcher.push("user", { id: "123", type: "admin" });
393
+ * matcher.push("user", { id: "456" }, "ns");
394
+ * matcher.push("container", null);
395
+ * ```
396
+ */
397
+ push(tagName: string, attrValues?: Record<string, any> | null, namespace?: string | null): void;
398
+
399
+ /**
400
+ * Pop the last tag from the path
401
+ * @returns The popped node or undefined if path is empty
402
+ */
403
+ pop(): PathNode | undefined;
404
+
405
+ /**
406
+ * Update current node's attribute values
407
+ * Useful when attributes are parsed after push
408
+ * @param attrValues - Attribute values
409
+ */
410
+ updateCurrent(attrValues: Record<string, any>): void;
411
+
412
+ /**
413
+ * Get current tag name
414
+ * @returns Current tag name or undefined if path is empty
415
+ */
416
+ getCurrentTag(): string | undefined;
417
+
418
+ /**
419
+ * Get current namespace
420
+ * @returns Current namespace or undefined if not present or path is empty
421
+ */
422
+ getCurrentNamespace(): string | undefined;
423
+
424
+ /**
425
+ * Get current node's attribute value
426
+ * @param attrName - Attribute name
427
+ * @returns Attribute value or undefined
428
+ */
429
+ getAttrValue(attrName: string): any;
430
+
431
+ /**
432
+ * Check if current node has an attribute
433
+ * @param attrName - Attribute name
434
+ */
435
+ hasAttr(attrName: string): boolean;
436
+
437
+ /**
438
+ * Get current node's sibling position (child index in parent)
439
+ * @returns Position index or -1 if path is empty
440
+ */
441
+ getPosition(): number;
442
+
443
+ /**
444
+ * Get current node's repeat counter (occurrence count of this tag name)
445
+ * @returns Counter value or -1 if path is empty
446
+ */
447
+ getCounter(): number;
448
+
449
+ /**
450
+ * Get current node's sibling index (alias for getPosition for backward compatibility)
451
+ * @returns Index or -1 if path is empty
452
+ * @deprecated Use getPosition() or getCounter() instead
453
+ */
454
+ getIndex(): number;
455
+
456
+ /**
457
+ * Get current path depth
458
+ * @returns Number of nodes in the path
459
+ */
460
+ getDepth(): number;
461
+
462
+ /**
463
+ * Get path as string
464
+ * @param separator - Optional separator (uses default if not provided)
465
+ * @param includeNamespace - Whether to include namespace in output
466
+ * @returns Path string (e.g., "root.users.user" or "ns:root.ns:users.user")
467
+ */
468
+ toString(separator?: string, includeNamespace?: boolean): string;
469
+
470
+ /**
471
+ * Get path as array of tag names
472
+ * @returns Array of tag names
473
+ */
474
+ toArray(): string[];
475
+
476
+ /**
477
+ * Reset the path to empty
478
+ */
479
+ reset(): void;
480
+
481
+ /**
482
+ * Match current path against an Expression
483
+ * @param expression - The expression to match against
484
+ * @returns True if current path matches the expression
485
+ *
486
+ * @example
487
+ * ```javascript
488
+ * const expr = new Expression("root.users.user[id]");
489
+ * const matcher = new Matcher();
490
+ *
491
+ * matcher.push("root");
492
+ * matcher.push("users");
493
+ * matcher.push("user", { id: "123" });
494
+ *
495
+ * matcher.matches(expr); // true
496
+ * ```
497
+ */
498
+ matches(expression: Expression): boolean;
499
+
500
+
501
+ /**
502
+ * Test whether the matcher's current path matches **any** expression in the set.
503
+ *
504
+ * Uses the pre-built index to evaluate only the relevant bucket(s):
505
+ * 1. Exact depth + tag — O(1) lookup
506
+ * 2. Depth-matched wildcard tag — O(1) lookup
507
+ * 3. Deep-wildcard expressions — always scanned (typically a small list)
508
+ *
509
+ * @param exprSet - A `ExpressionSet` instance
510
+ * @returns `true` if at least one expression matches the current path
511
+ *
512
+ * @example
513
+ * ```typescript
514
+ * // Replaces:
515
+ * // for (const expr of stopNodeExpressions) {
516
+ * // if (matcher.matches(expr)) return true;
517
+ * // }
518
+ *
519
+ * if (matcher.matchesAny(stopNodes)) {
520
+ * // current tag is a stop node
521
+ * }
522
+ * ```
523
+ */
524
+ matchesAny(exprSet: ExpressionSet): boolean;
525
+ /**
526
+ * Create a snapshot of current state
527
+ * @returns State snapshot that can be restored later
528
+ */
529
+ snapshot(): MatcherSnapshot;
530
+
531
+ /**
532
+ * Restore state from snapshot
533
+ * @param snapshot - State snapshot from previous snapshot() call
534
+ */
535
+ restore(snapshot: MatcherSnapshot): void;
536
+
537
+ /**
538
+ * Return a read-only view of this matcher.
539
+ */
540
+ readOnly(): ReadOnlyMatcher;
541
+ }
542
+
543
+ /**
544
+ * ExpressionSet - An indexed collection of Expressions for efficient bulk matching
545
+ *
546
+ * Pre-indexes expressions at insertion time by depth and terminal tag name so
547
+ * that `matchesAny()` performs an O(1) bucket lookup rather than a full O(E)
548
+ * linear scan on every tag.
549
+ *
550
+ * @example
551
+ * ```javascript
552
+ * const { Expression, ExpressionSet, Matcher } = require('path-expression-matcher');
553
+ *
554
+ * // Build once at config time
555
+ * const stopNodes = new ExpressionSet();
556
+ * stopNodes
557
+ * .add(new Expression('root.users.user'))
558
+ * .add(new Expression('root.config.*'))
559
+ * .add(new Expression('..script'))
560
+ * .seal();
561
+ *
562
+ * // Per-tag — hot path
563
+ * if (stopNodes.matchesAny(matcher)) { ... }
564
+ * ```
565
+ */
566
+ declare class ExpressionSet {
567
+ constructor();
568
+
569
+ /** Number of expressions currently in the set. */
570
+ readonly size: number;
571
+
572
+ /** Whether the set has been sealed against further modifications. */
573
+ readonly isSealed: boolean;
574
+
575
+ /**
576
+ * Add a single Expression. Duplicate patterns are silently ignored.
577
+ * @throws {TypeError} if the set has been sealed
578
+ */
579
+ add(expression: Expression): this;
580
+
581
+ /**
582
+ * Add multiple expressions at once.
583
+ * @throws {TypeError} if the set has been sealed
584
+ */
585
+ addAll(expressions: Expression[]): this;
586
+
587
+ /** Check whether an expression with the same pattern is already present. */
588
+ has(expression: Expression): boolean;
589
+
590
+ /**
591
+ * Seal the set against further modifications.
592
+ * Any subsequent call to add() or addAll() will throw a TypeError.
593
+ */
594
+ seal(): this;
595
+
596
+ /**
597
+ * Test whether the matcher's current path matches any expression in the set.
598
+ * Accepts both a Matcher instance and a ReadOnlyMatcher view.
599
+ *
600
+ *
601
+ * @param matcher - A `Matcher` instance or a `ReadOnlyMatcher` view
602
+ * @returns Expression if at least one expression matches the current path
603
+ */
604
+ matchesAny(matcher: Matcher | ReadOnlyMatcher): boolean;
605
+
606
+ /**
607
+ * Find the first expression in the set that matches the matcher's current path.
608
+
609
+ *
610
+ * @param matcher - A `Matcher` instance or a `ReadOnlyMatcher` view
611
+ * @returns Expression if at least one expression matches the current path
612
+ *
613
+ * @example
614
+ * ```typescript
615
+ * const node = stopNodes.findMatch(matcher);
616
+ * ```
617
+ */
618
+ findMatch(matcher: Matcher | ReadOnlyMatcher): Expression;
619
+ }
620
+
621
+ declare namespace pathExpressionMatcher {
622
+ export {
623
+ Expression,
624
+ Matcher,
625
+ ExpressionSet,
626
+ ExpressionOptions,
627
+ MatcherOptions,
628
+ Segment,
629
+ PathNode,
630
+ MatcherSnapshot,
631
+ };
632
+ }
633
+
634
+ export = pathExpressionMatcher;
@@ -0,0 +1,2 @@
1
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.pem=e():t.pem=e()}(this,()=>(()=>{"use strict";var t={d:(e,s)=>{for(var i in s)t.o(s,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:s[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{Expression:()=>s,ExpressionSet:()=>r,Matcher:()=>n,default:()=>h});class s{constructor(t,e={},s){this.pattern=t,this.separator=e.separator||".",this.segments=this._parse(t),this.data=s,this._hasDeepWildcard=this.segments.some(t=>"deep-wildcard"===t.type),this._hasAttributeCondition=this.segments.some(t=>void 0!==t.attrName),this._hasPositionSelector=this.segments.some(t=>void 0!==t.position)}_parse(t){const e=[];let s=0,i="";for(;s<t.length;)t[s]===this.separator?s+1<t.length&&t[s+1]===this.separator?(i.trim()&&(e.push(this._parseSegment(i.trim())),i=""),e.push({type:"deep-wildcard"}),s+=2):(i.trim()&&e.push(this._parseSegment(i.trim())),i="",s++):(i+=t[s],s++);return i.trim()&&e.push(this._parseSegment(i.trim())),e}_parseSegment(t){const e={type:"tag"};let s=null,i=t;const n=t.match(/^([^\[]+)(\[[^\]]*\])(.*)$/);if(n&&(i=n[1]+n[3],n[2])){const t=n[2].slice(1,-1);t&&(s=t)}let r,h,a=i;if(i.includes("::")){const e=i.indexOf("::");if(r=i.substring(0,e).trim(),a=i.substring(e+2).trim(),!r)throw new Error(`Invalid namespace in pattern: ${t}`)}let p=null;if(a.includes(":")){const t=a.lastIndexOf(":"),e=a.substring(0,t).trim(),s=a.substring(t+1).trim();["first","last","odd","even"].includes(s)||/^nth\(\d+\)$/.test(s)?(h=e,p=s):h=a}else h=a;if(!h)throw new Error(`Invalid segment pattern: ${t}`);if(e.tag=h,r&&(e.namespace=r),s)if(s.includes("=")){const t=s.indexOf("=");e.attrName=s.substring(0,t).trim(),e.attrValue=s.substring(t+1).trim()}else e.attrName=s.trim();if(p){const t=p.match(/^nth\((\d+)\)$/);t?(e.position="nth",e.positionValue=parseInt(t[1],10)):e.position=p}return e}get length(){return this.segments.length}hasDeepWildcard(){return this._hasDeepWildcard}hasAttributeCondition(){return this._hasAttributeCondition}hasPositionSelector(){return this._hasPositionSelector}toString(){return this.pattern}}class i{constructor(t){this._matcher=t}get separator(){return this._matcher.separator}getCurrentTag(){const t=this._matcher.path;return t.length>0?t[t.length-1].tag:void 0}getCurrentNamespace(){const t=this._matcher.path;return t.length>0?t[t.length-1].namespace:void 0}getAttrValue(t){const e=this._matcher.path;if(0!==e.length)return e[e.length-1].values?.[t]}hasAttr(t){const e=this._matcher.path;if(0===e.length)return!1;const s=e[e.length-1];return void 0!==s.values&&t in s.values}getPosition(){const t=this._matcher.path;return 0===t.length?-1:t[t.length-1].position??0}getCounter(){const t=this._matcher.path;return 0===t.length?-1:t[t.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this._matcher.path.length}toString(t,e=!0){return this._matcher.toString(t,e)}toArray(){return this._matcher.path.map(t=>t.tag)}matches(t){return this._matcher.matches(t)}matchesAny(t){return t.matchesAny(this._matcher)}}class n{constructor(t={}){this.separator=t.separator||".",this.path=[],this.siblingStacks=[],this._pathStringCache=null,this._view=new i(this)}push(t,e=null,s=null){this._pathStringCache=null,this.path.length>0&&(this.path[this.path.length-1].values=void 0);const i=this.path.length;this.siblingStacks[i]||(this.siblingStacks[i]=new Map);const n=this.siblingStacks[i],r=s?`${s}:${t}`:t,h=n.get(r)||0;let a=0;for(const t of n.values())a+=t;n.set(r,h+1);const p={tag:t,position:a,counter:h};null!=s&&(p.namespace=s),null!=e&&(p.values=e),this.path.push(p)}pop(){if(0===this.path.length)return;this._pathStringCache=null;const t=this.path.pop();return this.siblingStacks.length>this.path.length+1&&(this.siblingStacks.length=this.path.length+1),t}updateCurrent(t){if(this.path.length>0){const e=this.path[this.path.length-1];null!=t&&(e.values=t)}}getCurrentTag(){return this.path.length>0?this.path[this.path.length-1].tag:void 0}getCurrentNamespace(){return this.path.length>0?this.path[this.path.length-1].namespace:void 0}getAttrValue(t){if(0!==this.path.length)return this.path[this.path.length-1].values?.[t]}hasAttr(t){if(0===this.path.length)return!1;const e=this.path[this.path.length-1];return void 0!==e.values&&t in e.values}getPosition(){return 0===this.path.length?-1:this.path[this.path.length-1].position??0}getCounter(){return 0===this.path.length?-1:this.path[this.path.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this.path.length}toString(t,e=!0){const s=t||this.separator;if(s===this.separator&&!0===e){if(null!==this._pathStringCache)return this._pathStringCache;const t=this.path.map(t=>t.namespace?`${t.namespace}:${t.tag}`:t.tag).join(s);return this._pathStringCache=t,t}return this.path.map(t=>e&&t.namespace?`${t.namespace}:${t.tag}`:t.tag).join(s)}toArray(){return this.path.map(t=>t.tag)}reset(){this._pathStringCache=null,this.path=[],this.siblingStacks=[]}matches(t){const e=t.segments;return 0!==e.length&&(t.hasDeepWildcard()?this._matchWithDeepWildcard(e):this._matchSimple(e))}_matchSimple(t){if(this.path.length!==t.length)return!1;for(let e=0;e<t.length;e++)if(!this._matchSegment(t[e],this.path[e],e===this.path.length-1))return!1;return!0}_matchWithDeepWildcard(t){let e=this.path.length-1,s=t.length-1;for(;s>=0&&e>=0;){const i=t[s];if("deep-wildcard"===i.type){if(s--,s<0)return!0;const i=t[s];let n=!1;for(let t=e;t>=0;t--)if(this._matchSegment(i,this.path[t],t===this.path.length-1)){e=t-1,s--,n=!0;break}if(!n)return!1}else{if(!this._matchSegment(i,this.path[e],e===this.path.length-1))return!1;e--,s--}}return s<0}_matchSegment(t,e,s){if("*"!==t.tag&&t.tag!==e.tag)return!1;if(void 0!==t.namespace&&"*"!==t.namespace&&t.namespace!==e.namespace)return!1;if(void 0!==t.attrName){if(!s)return!1;if(!e.values||!(t.attrName in e.values))return!1;if(void 0!==t.attrValue&&String(e.values[t.attrName])!==String(t.attrValue))return!1}if(void 0!==t.position){if(!s)return!1;const i=e.counter??0;if("first"===t.position&&0!==i)return!1;if("odd"===t.position&&i%2!=1)return!1;if("even"===t.position&&i%2!=0)return!1;if("nth"===t.position&&i!==t.positionValue)return!1}return!0}matchesAny(t){return t.matchesAny(this)}snapshot(){return{path:this.path.map(t=>({...t})),siblingStacks:this.siblingStacks.map(t=>new Map(t))}}restore(t){this._pathStringCache=null,this.path=t.path.map(t=>({...t})),this.siblingStacks=t.siblingStacks.map(t=>new Map(t))}readOnly(){return this._view}}class r{constructor(){this._byDepthAndTag=new Map,this._wildcardByDepth=new Map,this._deepWildcards=[],this._patterns=new Set,this._sealed=!1}add(t){if(this._sealed)throw new TypeError("ExpressionSet is sealed. Create a new ExpressionSet to add more expressions.");if(this._patterns.has(t.pattern))return this;if(this._patterns.add(t.pattern),t.hasDeepWildcard())return this._deepWildcards.push(t),this;const e=t.length,s=t.segments[t.segments.length-1],i=s?.tag;if(i&&"*"!==i){const s=`${e}:${i}`;this._byDepthAndTag.has(s)||this._byDepthAndTag.set(s,[]),this._byDepthAndTag.get(s).push(t)}else this._wildcardByDepth.has(e)||this._wildcardByDepth.set(e,[]),this._wildcardByDepth.get(e).push(t);return this}addAll(t){for(const e of t)this.add(e);return this}has(t){return this._patterns.has(t.pattern)}get size(){return this._patterns.size}seal(){return this._sealed=!0,this}get isSealed(){return this._sealed}matchesAny(t){return null!==this.findMatch(t)}findMatch(t){const e=t.getDepth(),s=`${e}:${t.getCurrentTag()}`,i=this._byDepthAndTag.get(s);if(i)for(let e=0;e<i.length;e++)if(t.matches(i[e]))return i[e];const n=this._wildcardByDepth.get(e);if(n)for(let e=0;e<n.length;e++)if(t.matches(n[e]))return n[e];for(let e=0;e<this._deepWildcards.length;e++)if(t.matches(this._deepWildcards[e]))return this._deepWildcards[e];return null}}const h={Expression:s,Matcher:n,ExpressionSet:r};return e})());
2
+ //# sourceMappingURL=pem.min.js.map