@cdk8s/awscdk-resolver 0.0.535 → 0.0.537
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.jsii +3 -3
- package/lib/resolve.js +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/package.json +34 -34
- package/node_modules/@aws-sdk/core/dist-cjs/index.js +6 -6
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/protocols/index.js +6 -6
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonShapeSerializer.js +6 -6
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/JsonShapeSerializer.d.ts +2 -2
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/JsonShapeSerializer.d.ts +1 -1
- package/node_modules/@aws-sdk/core/package.json +11 -11
- package/node_modules/@aws-sdk/credential-provider-env/package.json +5 -5
- package/node_modules/@aws-sdk/credential-provider-http/package.json +10 -10
- package/node_modules/@aws-sdk/credential-provider-ini/package.json +14 -14
- package/node_modules/@aws-sdk/credential-provider-login/package.json +8 -8
- package/node_modules/@aws-sdk/credential-provider-node/package.json +12 -12
- package/node_modules/@aws-sdk/credential-provider-process/package.json +6 -6
- package/node_modules/@aws-sdk/credential-provider-sso/package.json +8 -8
- package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +7 -7
- package/node_modules/@aws-sdk/middleware-host-header/package.json +4 -4
- package/node_modules/@aws-sdk/middleware-logger/package.json +3 -3
- package/node_modules/@aws-sdk/middleware-recursion-detection/package.json +4 -4
- package/node_modules/@aws-sdk/middleware-user-agent/package.json +8 -8
- package/node_modules/@aws-sdk/nested-clients/package.json +32 -32
- package/node_modules/@aws-sdk/region-config-resolver/package.json +5 -5
- package/node_modules/@aws-sdk/token-providers/package.json +7 -7
- package/node_modules/@aws-sdk/types/package.json +2 -2
- package/node_modules/@aws-sdk/util-endpoints/package.json +5 -5
- package/node_modules/@aws-sdk/util-user-agent-browser/package.json +3 -3
- package/node_modules/@aws-sdk/util-user-agent-node/package.json +5 -5
- package/node_modules/@aws-sdk/xml-builder/package.json +2 -2
- package/node_modules/@smithy/config-resolver/package.json +5 -5
- package/node_modules/@smithy/core/package.json +7 -7
- package/node_modules/@smithy/credential-provider-imds/package.json +5 -5
- package/node_modules/@smithy/fetch-http-handler/package.json +5 -5
- package/node_modules/@smithy/hash-node/package.json +2 -2
- package/node_modules/@smithy/invalid-dependency/package.json +2 -2
- package/node_modules/@smithy/middleware-content-length/package.json +3 -3
- package/node_modules/@smithy/middleware-endpoint/package.json +8 -8
- package/node_modules/@smithy/middleware-retry/package.json +9 -9
- package/node_modules/@smithy/middleware-serde/package.json +4 -4
- package/node_modules/@smithy/middleware-stack/package.json +2 -2
- package/node_modules/@smithy/node-config-provider/package.json +4 -4
- package/node_modules/@smithy/node-http-handler/dist-cjs/index.js +6 -6
- package/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-manager.js +1 -1
- package/node_modules/@smithy/node-http-handler/dist-es/node-http2-handler.js +5 -5
- package/node_modules/@smithy/node-http-handler/dist-types/node-http2-handler.d.ts +14 -1
- package/node_modules/@smithy/node-http-handler/package.json +5 -5
- package/node_modules/@smithy/property-provider/package.json +2 -2
- package/node_modules/@smithy/protocol-http/package.json +2 -2
- package/node_modules/@smithy/querystring-builder/package.json +2 -2
- package/node_modules/@smithy/querystring-parser/package.json +2 -2
- package/node_modules/@smithy/service-error-classification/package.json +2 -2
- package/node_modules/@smithy/shared-ini-file-loader/package.json +2 -2
- package/node_modules/@smithy/signature-v4/dist-cjs/index.js +11 -5
- package/node_modules/@smithy/signature-v4/dist-es/SignatureV4.js +11 -5
- package/node_modules/@smithy/signature-v4/dist-types/SignatureV4.d.ts +3 -3
- package/node_modules/@smithy/signature-v4/package.json +4 -4
- package/node_modules/@smithy/smithy-client/dist-cjs/index.js +8 -1
- package/node_modules/@smithy/smithy-client/dist-es/command.js +8 -1
- package/node_modules/@smithy/smithy-client/package.json +7 -7
- package/node_modules/@smithy/types/dist-types/connection/config.d.ts +5 -0
- package/node_modules/@smithy/types/dist-types/signature.d.ts +20 -3
- package/node_modules/@smithy/types/package.json +1 -1
- package/node_modules/@smithy/url-parser/package.json +3 -3
- package/node_modules/@smithy/util-defaults-mode-browser/package.json +4 -4
- package/node_modules/@smithy/util-defaults-mode-node/package.json +7 -7
- package/node_modules/@smithy/util-endpoints/dist-cjs/index.js +165 -76
- package/node_modules/@smithy/util-endpoints/dist-es/bdd/BinaryDecisionDiagram.js +15 -0
- package/node_modules/@smithy/util-endpoints/dist-es/decideEndpoint.js +42 -0
- package/node_modules/@smithy/util-endpoints/dist-es/index.js +2 -0
- package/node_modules/@smithy/util-endpoints/dist-es/lib/coalesce.js +8 -0
- package/node_modules/@smithy/util-endpoints/dist-es/lib/getAttr.js +2 -1
- package/node_modules/@smithy/util-endpoints/dist-es/lib/index.js +3 -0
- package/node_modules/@smithy/util-endpoints/dist-es/lib/ite.js +3 -0
- package/node_modules/@smithy/util-endpoints/dist-es/lib/split.js +13 -0
- package/node_modules/@smithy/util-endpoints/dist-es/lib/substring.js +1 -1
- package/node_modules/@smithy/util-endpoints/dist-es/resolveEndpoint.js +8 -13
- package/node_modules/@smithy/util-endpoints/dist-es/utils/endpointFunctions.js +4 -1
- package/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateExpression.js +20 -5
- package/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateTemplate.js +3 -6
- package/node_modules/@smithy/util-endpoints/dist-es/utils/getEndpointHeaders.js +1 -1
- package/node_modules/@smithy/util-endpoints/dist-es/utils/getReferenceValue.js +1 -5
- package/node_modules/@smithy/util-endpoints/dist-types/bdd/BinaryDecisionDiagram.d.ts +22 -0
- package/node_modules/@smithy/util-endpoints/dist-types/decideEndpoint.d.ts +7 -0
- package/node_modules/@smithy/util-endpoints/dist-types/index.d.ts +2 -0
- package/node_modules/@smithy/util-endpoints/dist-types/lib/coalesce.d.ts +7 -0
- package/node_modules/@smithy/util-endpoints/dist-types/lib/index.d.ts +3 -0
- package/node_modules/@smithy/util-endpoints/dist-types/lib/ite.d.ts +6 -0
- package/node_modules/@smithy/util-endpoints/dist-types/lib/split.d.ts +11 -0
- package/node_modules/@smithy/util-endpoints/dist-types/utils/endpointFunctions.d.ts +4 -0
- package/node_modules/@smithy/util-endpoints/dist-types/utils/getReferenceValue.d.ts +3 -1
- package/node_modules/@smithy/util-endpoints/package.json +3 -3
- package/node_modules/@smithy/util-middleware/package.json +2 -2
- package/node_modules/@smithy/util-retry/dist-cjs/index.js +6 -0
- package/node_modules/@smithy/util-retry/dist-es/AdaptiveRetryStrategy.js +3 -0
- package/node_modules/@smithy/util-retry/dist-es/StandardRetryStrategy.js +3 -0
- package/node_modules/@smithy/util-retry/dist-types/AdaptiveRetryStrategy.d.ts +5 -0
- package/node_modules/@smithy/util-retry/dist-types/StandardRetryStrategy.d.ts +5 -0
- package/node_modules/@smithy/util-retry/package.json +3 -3
- package/node_modules/@smithy/util-stream/package.json +4 -4
- package/node_modules/@smithy/util-waiter/package.json +3 -3
- package/node_modules/path-expression-matcher/README.md +41 -54
- package/node_modules/path-expression-matcher/lib/pem.cjs +1 -1
- package/node_modules/path-expression-matcher/lib/pem.min.js +1 -1
- package/node_modules/path-expression-matcher/lib/pem.min.js.map +1 -1
- package/node_modules/path-expression-matcher/package.json +1 -1
- package/node_modules/path-expression-matcher/src/Matcher.js +223 -195
- package/node_modules/path-expression-matcher/src/index.d.ts +64 -247
- package/package.json +7 -7
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
export * from "./booleanEquals";
|
|
2
|
+
export * from "./coalesce";
|
|
2
3
|
export * from "./getAttr";
|
|
3
4
|
export * from "./isSet";
|
|
4
5
|
export * from "./isValidHostLabel";
|
|
6
|
+
export * from "./ite";
|
|
5
7
|
export * from "./not";
|
|
6
8
|
export * from "./parseURL";
|
|
9
|
+
export * from "./split";
|
|
7
10
|
export * from "./stringEquals";
|
|
8
11
|
export * from "./substring";
|
|
9
12
|
export * from "./uriEncode";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The split function divides a string into an array of substrings based on a non-empty delimiter.
|
|
3
|
+
* The behavior is controlled by the limit parameter:
|
|
4
|
+
*
|
|
5
|
+
* limit = 0: Split all occurrences (unlimited).
|
|
6
|
+
* limit = 1: No split performed (returns original string as single element array).
|
|
7
|
+
* limit > 1: Split into at most 'limit' parts (performs limit-1 splits).
|
|
8
|
+
*
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
export declare function split(value: string, delimiter: string, limit: number): string[];
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
+
import { coalesce, ite, split } from "../lib";
|
|
1
2
|
export declare const endpointFunctions: {
|
|
2
3
|
booleanEquals: (value1: boolean, value2: boolean) => boolean;
|
|
4
|
+
coalesce: typeof coalesce;
|
|
3
5
|
getAttr: (value: import("../lib").GetAttrValue, path: string) => import("../lib").GetAttrValue;
|
|
4
6
|
isSet: (value: unknown) => value is {};
|
|
5
7
|
isValidHostLabel: (value: string, allowSubDomains?: boolean) => boolean;
|
|
8
|
+
ite: typeof ite;
|
|
6
9
|
not: (value: boolean) => boolean;
|
|
7
10
|
parseURL: (value: string | URL | import("@smithy/types").Endpoint) => import("@smithy/types").EndpointURL | null;
|
|
11
|
+
split: typeof split;
|
|
8
12
|
stringEquals: (value1: string, value2: string) => boolean;
|
|
9
13
|
substring: (input: string, start: number, stop: number, reverse: boolean) => string | null;
|
|
10
14
|
uriEncode: (value: string) => string;
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
import type { EvaluateOptions, ReferenceObject } from "../types";
|
|
2
|
-
export declare const getReferenceValue: ({ ref }: ReferenceObject, options: EvaluateOptions) => import("
|
|
2
|
+
export declare const getReferenceValue: ({ ref }: ReferenceObject, options: EvaluateOptions) => string | number | boolean | import("@smithy/types").EndpointPartition | import("@smithy/types").EndpointARN | {
|
|
3
|
+
[key: string]: import("../types").FunctionReturn;
|
|
4
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smithy/util-endpoints",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.1",
|
|
4
4
|
"description": "Utilities to help with endpoint resolution.",
|
|
5
5
|
"main": "./dist-cjs/index.js",
|
|
6
6
|
"module": "./dist-es/index.js",
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
"license": "Apache-2.0",
|
|
29
29
|
"sideEffects": false,
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@smithy/node-config-provider": "^4.3.
|
|
32
|
-
"@smithy/types": "^4.14.
|
|
31
|
+
"@smithy/node-config-provider": "^4.3.14",
|
|
32
|
+
"@smithy/types": "^4.14.1",
|
|
33
33
|
"tslib": "^2.6.2"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smithy/util-middleware",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.14",
|
|
4
4
|
"description": "Shared utilities for to be used in middleware packages.",
|
|
5
5
|
"main": "./dist-cjs/index.js",
|
|
6
6
|
"module": "./dist-es/index.js",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"license": "Apache-2.0",
|
|
28
28
|
"sideEffects": false,
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@smithy/types": "^4.14.
|
|
30
|
+
"@smithy/types": "^4.14.1",
|
|
31
31
|
"tslib": "^2.6.2"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
@@ -261,6 +261,9 @@ class StandardRetryStrategy {
|
|
|
261
261
|
isRetryableError(errorType) {
|
|
262
262
|
return errorType === "THROTTLING" || errorType === "TRANSIENT";
|
|
263
263
|
}
|
|
264
|
+
async maxAttempts() {
|
|
265
|
+
return this.maxAttemptsProvider();
|
|
266
|
+
}
|
|
264
267
|
}
|
|
265
268
|
|
|
266
269
|
class AdaptiveRetryStrategy {
|
|
@@ -289,6 +292,9 @@ class AdaptiveRetryStrategy {
|
|
|
289
292
|
this.rateLimiter.updateClientSendingRate({});
|
|
290
293
|
this.standardRetryStrategy.recordSuccess(token);
|
|
291
294
|
}
|
|
295
|
+
async maxAttemptsProvider() {
|
|
296
|
+
return this.standardRetryStrategy.maxAttempts();
|
|
297
|
+
}
|
|
292
298
|
}
|
|
293
299
|
|
|
294
300
|
class ConfiguredRetryStrategy extends StandardRetryStrategy {
|
|
@@ -30,4 +30,9 @@ export declare class AdaptiveRetryStrategy implements RetryStrategyV2 {
|
|
|
30
30
|
acquireInitialRetryToken(retryTokenScope: string): Promise<RetryToken>;
|
|
31
31
|
refreshRetryTokenForRetry(tokenToRenew: StandardRetryToken, errorInfo: RetryErrorInfo): Promise<RetryToken>;
|
|
32
32
|
recordSuccess(token: StandardRetryToken): void;
|
|
33
|
+
/**
|
|
34
|
+
* There is an existing integration which accesses this field.
|
|
35
|
+
* @deprecated
|
|
36
|
+
*/
|
|
37
|
+
maxAttemptsProvider(): Promise<number>;
|
|
33
38
|
}
|
|
@@ -40,4 +40,9 @@ export declare class StandardRetryStrategy implements RetryStrategyV2 {
|
|
|
40
40
|
private shouldRetry;
|
|
41
41
|
private getCapacityCost;
|
|
42
42
|
private isRetryableError;
|
|
43
|
+
/**
|
|
44
|
+
* There is an existing integration which accesses this field.
|
|
45
|
+
* @deprecated
|
|
46
|
+
*/
|
|
47
|
+
maxAttempts(): Promise<number>;
|
|
43
48
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smithy/util-retry",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.2",
|
|
4
4
|
"description": "Shared retry utilities to be used in middleware packages.",
|
|
5
5
|
"main": "./dist-cjs/index.js",
|
|
6
6
|
"module": "./dist-es/index.js",
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"license": "Apache-2.0",
|
|
31
31
|
"sideEffects": false,
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@smithy/service-error-classification": "^4.2.
|
|
34
|
-
"@smithy/types": "^4.14.
|
|
33
|
+
"@smithy/service-error-classification": "^4.2.14",
|
|
34
|
+
"@smithy/types": "^4.14.1",
|
|
35
35
|
"tslib": "^2.6.2"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smithy/util-stream",
|
|
3
|
-
"version": "4.5.
|
|
3
|
+
"version": "4.5.23",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"build": "concurrently 'yarn:build:types' 'yarn:build:es:cjs'",
|
|
6
6
|
"build:es:cjs": "yarn g:tsc -p tsconfig.es.json && node ../../scripts/inline util-stream",
|
|
@@ -28,9 +28,9 @@
|
|
|
28
28
|
"license": "Apache-2.0",
|
|
29
29
|
"sideEffects": false,
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@smithy/fetch-http-handler": "^5.3.
|
|
32
|
-
"@smithy/node-http-handler": "^4.5.
|
|
33
|
-
"@smithy/types": "^4.14.
|
|
31
|
+
"@smithy/fetch-http-handler": "^5.3.17",
|
|
32
|
+
"@smithy/node-http-handler": "^4.5.3",
|
|
33
|
+
"@smithy/types": "^4.14.1",
|
|
34
34
|
"@smithy/util-base64": "^4.3.2",
|
|
35
35
|
"@smithy/util-buffer-from": "^4.2.2",
|
|
36
36
|
"@smithy/util-hex-encoding": "^4.2.2",
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smithy/util-waiter",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.16",
|
|
4
4
|
"description": "Shared utilities for client waiters for the AWS SDK",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@smithy/types": "^4.14.
|
|
6
|
+
"@smithy/types": "^4.14.1",
|
|
7
7
|
"tslib": "^2.6.2"
|
|
8
8
|
},
|
|
9
9
|
"scripts": {
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"directory": "packages/util-waiter"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@smithy/abort-controller": "^4.2.
|
|
50
|
+
"@smithy/abort-controller": "^4.2.14",
|
|
51
51
|
"concurrently": "7.0.0",
|
|
52
52
|
"downlevel-dts": "0.10.1",
|
|
53
53
|
"premove": "4.0.0",
|
|
@@ -4,10 +4,11 @@ Efficient path tracking and pattern matching for XML, JSON, YAML or any other pa
|
|
|
4
4
|
|
|
5
5
|
## 🎯 Purpose
|
|
6
6
|
|
|
7
|
-
`path-expression-matcher` provides
|
|
7
|
+
`path-expression-matcher` provides three core classes for tracking and matching paths:
|
|
8
8
|
|
|
9
9
|
- **`Expression`**: Parses and stores pattern expressions (e.g., `"root.users.user[id]"`)
|
|
10
10
|
- **`Matcher`**: Tracks current path during parsing and matches against expressions
|
|
11
|
+
- **`MatcherView`**: A lightweight read-only view of a `Matcher`, safe to pass to callbacks
|
|
11
12
|
|
|
12
13
|
Compatible with [fast-xml-parser](https://github.com/NaturalIntelligence/fast-xml-parser) and similar tools.
|
|
13
14
|
|
|
@@ -368,51 +369,51 @@ matcher.restore(snapshot);
|
|
|
368
369
|
|
|
369
370
|
##### `readOnly()`
|
|
370
371
|
|
|
371
|
-
Returns a
|
|
372
|
+
Returns a **`MatcherView`** — a lightweight, live read-only view of the matcher. All query and inspection methods work normally and always reflect the current state of the underlying matcher. Mutation methods (`push`, `pop`, `reset`, `updateCurrent`, `restore`) simply don't exist on `MatcherView`, so misuse is caught at **compile time** by TypeScript rather than at runtime.
|
|
372
373
|
|
|
373
|
-
This is the recommended way to share the matcher with
|
|
374
|
+
The **same instance** is returned on every call — no allocation occurs per invocation. This is the recommended way to share the matcher with callbacks, plugins, or any external code that only needs to inspect the current path.
|
|
374
375
|
|
|
375
376
|
```javascript
|
|
376
|
-
const
|
|
377
|
+
const view = matcher.readOnly();
|
|
378
|
+
// Same reference every time — safe to cache
|
|
379
|
+
view === matcher.readOnly(); // true
|
|
377
380
|
```
|
|
378
381
|
|
|
379
|
-
**What works on the
|
|
382
|
+
**What works on the view:**
|
|
380
383
|
|
|
381
384
|
```javascript
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
ro.snapshot() // ✓ snapshot (can be used to restore the real matcher)
|
|
385
|
+
view.matches(expr) // ✓ pattern matching
|
|
386
|
+
view.getCurrentTag() // ✓ current tag name
|
|
387
|
+
view.getCurrentNamespace() // ✓ current namespace
|
|
388
|
+
view.getAttrValue("id") // ✓ attribute value
|
|
389
|
+
view.hasAttr("id") // ✓ attribute presence check
|
|
390
|
+
view.getPosition() // ✓ sibling position
|
|
391
|
+
view.getCounter() // ✓ occurrence counter
|
|
392
|
+
view.getDepth() // ✓ path depth
|
|
393
|
+
view.toString() // ✓ path as string
|
|
394
|
+
view.toArray() // ✓ path as array
|
|
393
395
|
```
|
|
394
396
|
|
|
395
|
-
**What
|
|
397
|
+
**What doesn't exist (compile-time error in TypeScript):**
|
|
396
398
|
|
|
397
399
|
```javascript
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
ro.separator = '/' // ✗ TypeError: Cannot set property on a read-only Matcher
|
|
400
|
+
view.push("child", {}) // ✗ Property 'push' does not exist on type 'MatcherView'
|
|
401
|
+
view.pop() // ✗ Property 'pop' does not exist on type 'MatcherView'
|
|
402
|
+
view.reset() // ✗ Property 'reset' does not exist on type 'MatcherView'
|
|
403
|
+
view.updateCurrent({}) // ✗ Property 'updateCurrent' does not exist on type 'MatcherView'
|
|
404
|
+
view.restore(snapshot) // ✗ Property 'restore' does not exist on type 'MatcherView'
|
|
404
405
|
```
|
|
405
406
|
|
|
406
|
-
**
|
|
407
|
+
**The view is live** — it always reflects the current state of the underlying matcher.
|
|
407
408
|
|
|
408
409
|
```javascript
|
|
409
410
|
const matcher = new Matcher();
|
|
410
|
-
const
|
|
411
|
+
const view = matcher.readOnly();
|
|
411
412
|
|
|
412
413
|
matcher.push("root");
|
|
413
|
-
|
|
414
|
+
view.getDepth(); // 1 — immediately reflects the push
|
|
414
415
|
matcher.push("users");
|
|
415
|
-
|
|
416
|
+
view.getDepth(); // 2 — still live
|
|
416
417
|
```
|
|
417
418
|
|
|
418
419
|
## 💡 Usage Examples
|
|
@@ -550,9 +551,9 @@ const expr = new Expression("root.item:first");
|
|
|
550
551
|
console.log(matcher.matches(expr)); // false (counter=1, not 0)
|
|
551
552
|
```
|
|
552
553
|
|
|
553
|
-
### Example 8: Passing a Read-Only
|
|
554
|
+
### Example 8: Passing a Read-Only View to External Consumers
|
|
554
555
|
|
|
555
|
-
When passing the matcher into callbacks, plugins, or other code you don't control, use `readOnly()` to
|
|
556
|
+
When passing the matcher into callbacks, plugins, or other code you don't control, use `readOnly()` to get a `MatcherView` — it can inspect but never mutate parser state.
|
|
556
557
|
|
|
557
558
|
```javascript
|
|
558
559
|
import { Expression, Matcher } from 'path-expression-matcher';
|
|
@@ -564,40 +565,26 @@ const adminExpr = new Expression("..user[type=admin]");
|
|
|
564
565
|
function parseTag(tagName, attrs, onTag) {
|
|
565
566
|
matcher.push(tagName, attrs);
|
|
566
567
|
|
|
567
|
-
// Pass
|
|
568
|
+
// Pass MatcherView — consumer can inspect but not mutate
|
|
568
569
|
onTag(matcher.readOnly());
|
|
569
570
|
|
|
570
571
|
matcher.pop();
|
|
571
572
|
}
|
|
572
573
|
|
|
573
574
|
// Safe consumer — can only read
|
|
574
|
-
function myPlugin(
|
|
575
|
-
if (
|
|
576
|
-
console.log("Admin at path:",
|
|
577
|
-
console.log("Depth:",
|
|
578
|
-
console.log("ID:",
|
|
575
|
+
function myPlugin(view) {
|
|
576
|
+
if (view.matches(adminExpr)) {
|
|
577
|
+
console.log("Admin at path:", view.toString());
|
|
578
|
+
console.log("Depth:", view.getDepth());
|
|
579
|
+
console.log("ID:", view.getAttrValue("id"));
|
|
579
580
|
}
|
|
580
581
|
}
|
|
581
582
|
|
|
582
|
-
//
|
|
583
|
-
//
|
|
583
|
+
// view.push(...) or view.reset() don't exist on MatcherView —
|
|
584
|
+
// TypeScript catches misuse at compile time.
|
|
584
585
|
parseTag("user", { id: "1", type: "admin" }, myPlugin);
|
|
585
586
|
```
|
|
586
587
|
|
|
587
|
-
**Combining with `snapshot()`:** A snapshot taken via the read-only view can still be used to restore the real matcher.
|
|
588
|
-
|
|
589
|
-
```javascript
|
|
590
|
-
const matcher = new Matcher();
|
|
591
|
-
matcher.push("root");
|
|
592
|
-
matcher.push("users");
|
|
593
|
-
|
|
594
|
-
const ro = matcher.readOnly();
|
|
595
|
-
const snap = ro.snapshot(); // ✓ snapshot works on read-only view
|
|
596
|
-
|
|
597
|
-
matcher.push("user"); // continue parsing...
|
|
598
|
-
matcher.restore(snap); // restore to "root.users" using the snapshot
|
|
599
|
-
```
|
|
600
|
-
|
|
601
588
|
```javascript
|
|
602
589
|
const matcher = new Matcher();
|
|
603
590
|
const soapExpr = new Expression("soap::Envelope.soap::Body..ns::UserId");
|
|
@@ -799,7 +786,7 @@ Whether `seal()` has been called.
|
|
|
799
786
|
### `matchesAny(matcher)` → `boolean`
|
|
800
787
|
|
|
801
788
|
Returns `true` if the matcher's current path matches **any** expression in the set.
|
|
802
|
-
Accepts both a `Matcher` instance and a `
|
|
789
|
+
Accepts both a `Matcher` instance and a `MatcherView`.
|
|
803
790
|
|
|
804
791
|
```javascript
|
|
805
792
|
if (stopNodes.matchesAny(matcher)) { /* ... */ }
|
|
@@ -818,7 +805,7 @@ In practice, deep-wildcard expressions are rare in configs, so the list stays sm
|
|
|
818
805
|
|
|
819
806
|
### `findMatch(matcher)` → `Expression`
|
|
820
807
|
|
|
821
|
-
Returns the Expression instance that matched the current path. Accepts both a `Matcher` instance and a `
|
|
808
|
+
Returns the Expression instance that matched the current path. Accepts both a `Matcher` instance and a `MatcherView`.
|
|
822
809
|
|
|
823
810
|
```javascript
|
|
824
811
|
const node = stopNodes.findMatch(matcher);
|
|
@@ -882,4 +869,4 @@ MIT
|
|
|
882
869
|
|
|
883
870
|
## 🤝 Contributing
|
|
884
871
|
|
|
885
|
-
Issues and PRs welcome! This package is designed to be used by XML/JSON parsers like fast-xml-parser.
|
|
872
|
+
Issues and PRs welcome! This package is designed to be used by XML/JSON parsers like fast-xml-parser. But can be used with any formar parser.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";var t={d:(e,s)=>{for(var
|
|
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})();
|
|
@@ -1,2 +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
|
|
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
2
|
//# sourceMappingURL=pem.min.js.map
|