@cdklabs/cdk-ecs-codedeploy 0.0.432 → 0.0.434
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/.jsii.tabl.json +1 -1
- package/lib/api-canary/index.js +1 -1
- package/lib/ecs-appspec/index.js +1 -1
- package/lib/ecs-deployment/index.js +1 -1
- package/lib/ecs-patterns/application-load-balanced-codedeployed-fargate-service.js +1 -1
- package/node_modules/@aws/lambda-invoke-store/dist-cjs/invoke-store.js +2 -2
- package/node_modules/@aws/lambda-invoke-store/dist-es/invoke-store.js +2 -2
- package/node_modules/@aws/lambda-invoke-store/dist-types/invoke-store.d.ts +1 -1
- package/node_modules/@aws/lambda-invoke-store/package.json +1 -1
- package/node_modules/@aws-sdk/client-codedeploy/README.md +26 -46
- package/node_modules/@aws-sdk/client-codedeploy/package.json +34 -34
- package/node_modules/@aws-sdk/core/dist-cjs/index.js +4 -0
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/protocols/index.js +4 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/index.js +2 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/AwsEc2QueryProtocol.js +3 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/index.d.ts +2 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/query/AwsEc2QueryProtocol.d.ts +4 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/query/QuerySerializerSettings.d.ts +3 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/index.d.ts +2 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/query/AwsEc2QueryProtocol.d.ts +1 -0
- 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/dist-cjs/index.js +75 -19
- package/node_modules/@aws-sdk/util-user-agent-node/dist-es/getNodeModulesParentDirs.js +15 -0
- package/node_modules/@aws-sdk/util-user-agent-node/dist-es/getSanitizedDevTypeScriptVersion.js +14 -0
- package/node_modules/@aws-sdk/util-user-agent-node/dist-es/getTypeScriptUserAgentPair.js +53 -7
- package/node_modules/@aws-sdk/util-user-agent-node/dist-types/{getTypeScriptPackageJsonPaths.d.ts → getNodeModulesParentDirs.d.ts} +2 -2
- package/node_modules/@aws-sdk/util-user-agent-node/dist-types/getSanitizedDevTypeScriptVersion.d.ts +8 -0
- package/node_modules/@aws-sdk/util-user-agent-node/dist-types/ts3.4/getNodeModulesParentDirs.d.ts +1 -0
- package/node_modules/@aws-sdk/util-user-agent-node/dist-types/ts3.4/getSanitizedDevTypeScriptVersion.d.ts +3 -0
- package/node_modules/@aws-sdk/util-user-agent-node/package.json +6 -5
- package/node_modules/@aws-sdk/xml-builder/dist-cjs/index.js +21 -11
- package/node_modules/@aws-sdk/xml-builder/dist-cjs/xml-parser.js +5 -1
- package/node_modules/@aws-sdk/xml-builder/dist-es/escape-attribute.js +8 -1
- package/node_modules/@aws-sdk/xml-builder/dist-es/escape-element.js +13 -10
- package/node_modules/@aws-sdk/xml-builder/dist-es/xml-parser.js +5 -1
- package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/CHANGELOG.md +40 -4
- package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/README.md +8 -7
- package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxbuilder.min.js +2 -0
- package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxbuilder.min.js.map +1 -0
- package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxp.cjs +1 -0
- package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/lib/fxp.d.cts +82 -20
- package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxp.min.js +2 -0
- package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxp.min.js.map +1 -0
- package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxparser.min.js +2 -0
- package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxparser.min.js.map +1 -0
- package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxvalidator.min.js.map +1 -0
- package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/pem.d.cts +148 -0
- package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/package.json +4 -3
- package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/fxp.d.ts +75 -19
- package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/pem.d.ts +135 -0
- package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/util.js +18 -0
- package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/xmlparser/DocTypeReader.js +37 -18
- package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js +159 -0
- package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/xmlparser/OrderedObjParser.js +298 -116
- package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/xmlparser/XMLParser.js +2 -2
- package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/xmlparser/node2json.js +65 -15
- package/node_modules/{strnum → @aws-sdk/xml-builder/node_modules/strnum}/CHANGELOG.md +9 -2
- package/node_modules/{strnum → @aws-sdk/xml-builder/node_modules/strnum}/package.json +1 -1
- package/node_modules/{strnum → @aws-sdk/xml-builder/node_modules/strnum}/strnum.js +12 -6
- package/node_modules/{strnum → @aws-sdk/xml-builder/node_modules/strnum}/tests/strnum_test.js +3 -0
- package/node_modules/@aws-sdk/xml-builder/node_modules/strnum/tests/temp.js +8 -0
- package/node_modules/@aws-sdk/xml-builder/package.json +3 -3
- package/node_modules/@smithy/abort-controller/package.json +2 -2
- package/node_modules/@smithy/config-resolver/dist-cjs/index.js +12 -0
- package/node_modules/@smithy/config-resolver/dist-es/endpointsConfig/NodeUseDualstackEndpointConfigOptions.js +5 -0
- package/node_modules/@smithy/config-resolver/dist-es/endpointsConfig/NodeUseFipsEndpointConfigOptions.js +5 -0
- package/node_modules/@smithy/config-resolver/dist-types/endpointsConfig/NodeUseDualstackEndpointConfigOptions.d.ts +6 -0
- package/node_modules/@smithy/config-resolver/dist-types/endpointsConfig/NodeUseFipsEndpointConfigOptions.d.ts +6 -0
- package/node_modules/@smithy/config-resolver/dist-types/ts3.4/endpointsConfig/NodeUseDualstackEndpointConfigOptions.d.ts +6 -0
- package/node_modules/@smithy/config-resolver/dist-types/ts3.4/endpointsConfig/NodeUseFipsEndpointConfigOptions.d.ts +6 -0
- package/node_modules/@smithy/config-resolver/package.json +5 -5
- package/node_modules/@smithy/core/dist-cjs/index.js +1 -2
- package/node_modules/@smithy/core/dist-cjs/submodules/cbor/index.js +7 -1
- package/node_modules/@smithy/core/dist-cjs/submodules/endpoints/index.js +22 -0
- package/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js +11 -1
- package/node_modules/@smithy/core/dist-cjs/submodules/schema/index.js +41 -4
- package/node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/getHttpAuthSchemePlugin.js +1 -2
- package/node_modules/@smithy/core/dist-es/submodules/cbor/parseCborBody.js +7 -1
- package/node_modules/@smithy/core/dist-es/submodules/endpoints/index.js +1 -0
- package/node_modules/@smithy/core/dist-es/submodules/endpoints/toEndpointV1.js +17 -0
- package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpProtocol.js +10 -0
- package/node_modules/@smithy/core/dist-es/submodules/protocols/RpcProtocol.js +1 -1
- package/node_modules/@smithy/core/dist-es/submodules/schema/middleware/schemaSerializationMiddleware.js +3 -2
- package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/NormalizedSchema.js +30 -1
- package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/translateTraits.js +5 -1
- package/node_modules/@smithy/core/dist-types/submodules/endpoints/index.d.ts +1 -0
- package/node_modules/@smithy/core/dist-types/submodules/endpoints/toEndpointV1.d.ts +6 -0
- package/node_modules/@smithy/core/dist-types/submodules/schema/schemas/NormalizedSchema.d.ts +11 -0
- package/node_modules/@smithy/core/dist-types/submodules/schema/schemas/translateTraits.d.ts +6 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/endpoints/index.d.ts +1 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/endpoints/toEndpointV1.d.ts +6 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/schema/schemas/NormalizedSchema.d.ts +11 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/schema/schemas/translateTraits.d.ts +6 -0
- package/node_modules/@smithy/core/endpoints.d.ts +7 -0
- package/node_modules/@smithy/core/endpoints.js +6 -0
- package/node_modules/@smithy/core/package.json +16 -7
- package/node_modules/@smithy/credential-provider-imds/package.json +5 -5
- package/node_modules/@smithy/fetch-http-handler/dist-cjs/index.js +4 -1
- package/node_modules/@smithy/fetch-http-handler/dist-es/fetch-http-handler.js +4 -1
- 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/dist-cjs/index.js +17 -1
- package/node_modules/@smithy/middleware-endpoint/dist-es/adaptors/getEndpointFromInstructions.js +9 -0
- package/node_modules/@smithy/middleware-endpoint/dist-es/adaptors/toEndpointV1.js +8 -1
- package/node_modules/@smithy/middleware-endpoint/dist-types/adaptors/toEndpointV1.d.ts +1 -0
- package/node_modules/@smithy/middleware-endpoint/dist-types/resolveEndpointConfig.d.ts +2 -2
- package/node_modules/@smithy/middleware-endpoint/dist-types/ts3.4/adaptors/toEndpointV1.d.ts +1 -0
- package/node_modules/@smithy/middleware-endpoint/dist-types/ts3.4/resolveEndpointConfig.d.ts +2 -2
- package/node_modules/@smithy/middleware-endpoint/package.json +8 -8
- package/node_modules/@smithy/middleware-retry/dist-cjs/index.js +9 -12
- package/node_modules/@smithy/middleware-retry/dist-es/configurations.js +9 -12
- package/node_modules/@smithy/middleware-retry/package.json +8 -8
- package/node_modules/@smithy/middleware-serde/dist-cjs/index.js +3 -2
- package/node_modules/@smithy/middleware-serde/dist-es/serializerMiddleware.js +3 -2
- package/node_modules/@smithy/middleware-serde/package.json +4 -3
- 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 +48 -38
- package/node_modules/@smithy/node-http-handler/dist-es/build-abort-error.js +4 -1
- package/node_modules/@smithy/node-http-handler/dist-es/node-http-handler.js +38 -31
- 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 +1 -1
- package/node_modules/@smithy/node-http-handler/dist-es/readable.mock.js +1 -1
- package/node_modules/@smithy/node-http-handler/dist-es/server.mock.js +6 -6
- package/node_modules/@smithy/node-http-handler/dist-es/stream-collector/collector.js +1 -1
- package/node_modules/@smithy/node-http-handler/dist-es/stream-collector/readable.mock.js +1 -1
- package/node_modules/@smithy/node-http-handler/dist-es/write-request-body.js +1 -1
- package/node_modules/@smithy/node-http-handler/dist-types/build-abort-error.d.ts +4 -3
- package/node_modules/@smithy/node-http-handler/dist-types/get-transformed-headers.d.ts +1 -1
- package/node_modules/@smithy/node-http-handler/dist-types/node-http-handler.d.ts +4 -4
- package/node_modules/@smithy/node-http-handler/dist-types/node-http2-connection-manager.d.ts +1 -1
- package/node_modules/@smithy/node-http-handler/dist-types/node-http2-connection-pool.d.ts +1 -1
- package/node_modules/@smithy/node-http-handler/dist-types/readable.mock.d.ts +2 -2
- package/node_modules/@smithy/node-http-handler/dist-types/server.mock.d.ts +3 -3
- package/node_modules/@smithy/node-http-handler/dist-types/set-connection-timeout.d.ts +1 -1
- package/node_modules/@smithy/node-http-handler/dist-types/set-request-timeout.d.ts +1 -1
- package/node_modules/@smithy/node-http-handler/dist-types/set-socket-keep-alive.d.ts +1 -1
- package/node_modules/@smithy/node-http-handler/dist-types/set-socket-timeout.d.ts +1 -1
- package/node_modules/@smithy/node-http-handler/dist-types/stream-collector/collector.d.ts +1 -1
- package/node_modules/@smithy/node-http-handler/dist-types/stream-collector/readable.mock.d.ts +2 -2
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/build-abort-error.d.ts +4 -3
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/get-transformed-headers.d.ts +1 -1
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http-handler.d.ts +4 -4
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2-connection-manager.d.ts +1 -1
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2-connection-pool.d.ts +1 -1
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/readable.mock.d.ts +2 -2
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/server.mock.d.ts +3 -3
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-connection-timeout.d.ts +1 -1
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-request-timeout.d.ts +1 -1
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-socket-keep-alive.d.ts +1 -1
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-socket-timeout.d.ts +1 -1
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/stream-collector/collector.d.ts +1 -1
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/stream-collector/readable.mock.d.ts +2 -2
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/write-request-body.d.ts +2 -2
- package/node_modules/@smithy/node-http-handler/dist-types/write-request-body.d.ts +2 -2
- 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/package.json +4 -4
- package/node_modules/@smithy/smithy-client/package.json +7 -7
- package/node_modules/@smithy/types/dist-types/http.d.ts +1 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/http.d.ts +1 -0
- 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/package.json +3 -3
- package/node_modules/@smithy/util-middleware/package.json +2 -2
- 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/dist-cjs/index.js +1 -1
- package/node_modules/@smithy/util-waiter/dist-es/poller.js +1 -1
- package/node_modules/@smithy/util-waiter/package.json +3 -3
- package/node_modules/fast-xml-builder/CHANGELOG.md +16 -0
- package/node_modules/fast-xml-builder/README.md +1 -1
- package/node_modules/fast-xml-builder/lib/fxb.cjs +1 -0
- package/node_modules/fast-xml-builder/lib/fxb.d.cts +22 -9
- package/node_modules/fast-xml-builder/lib/fxb.min.js +2 -0
- package/node_modules/fast-xml-builder/lib/fxb.min.js.map +1 -0
- package/node_modules/fast-xml-builder/package.json +7 -5
- package/node_modules/fast-xml-builder/src/fxb.d.ts +27 -3
- package/node_modules/fast-xml-builder/src/fxb.js +265 -21
- package/node_modules/fast-xml-builder/src/orderedJs2Xml.js +165 -18
- package/node_modules/path-expression-matcher/LICENSE +21 -0
- package/node_modules/path-expression-matcher/README.md +720 -0
- package/node_modules/path-expression-matcher/lib/pem.cjs +1 -0
- package/node_modules/path-expression-matcher/lib/pem.d.cts +523 -0
- package/node_modules/path-expression-matcher/lib/pem.min.js +2 -0
- package/node_modules/path-expression-matcher/lib/pem.min.js.map +1 -0
- package/node_modules/path-expression-matcher/package.json +78 -0
- package/node_modules/path-expression-matcher/src/Expression.js +232 -0
- package/node_modules/path-expression-matcher/src/Matcher.js +498 -0
- package/node_modules/path-expression-matcher/src/index.d.ts +518 -0
- package/node_modules/path-expression-matcher/src/index.js +28 -0
- package/package.json +4 -4
- package/node_modules/@aws-sdk/util-user-agent-node/dist-es/getTypeScriptPackageJsonPaths.js +0 -17
- package/node_modules/@aws-sdk/util-user-agent-node/dist-types/ts3.4/getTypeScriptPackageJsonPaths.d.ts +0 -3
- package/node_modules/fast-xml-builder/lib/builder.cjs +0 -1
- package/node_modules/fast-xml-builder/lib/builder.min.js +0 -2
- package/node_modules/fast-xml-builder/lib/builder.min.js.map +0 -1
- package/node_modules/fast-xml-parser/lib/fxbuilder.min.js +0 -2
- package/node_modules/fast-xml-parser/lib/fxbuilder.min.js.map +0 -1
- package/node_modules/fast-xml-parser/lib/fxp.cjs +0 -1
- package/node_modules/fast-xml-parser/lib/fxp.min.js +0 -2
- package/node_modules/fast-xml-parser/lib/fxp.min.js.map +0 -1
- package/node_modules/fast-xml-parser/lib/fxparser.min.js +0 -2
- package/node_modules/fast-xml-parser/lib/fxparser.min.js.map +0 -1
- package/node_modules/fast-xml-parser/lib/fxvalidator.min.js.map +0 -1
- package/node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js +0 -88
- /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/LICENSE +0 -0
- /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/lib/fxvalidator.min.js +0 -0
- /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/cli/cli.js +0 -0
- /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/cli/man.js +0 -0
- /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/cli/read.js +0 -0
- /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/fxp.js +0 -0
- /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/ignoreAttributes.js +0 -0
- /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/v6/CharsSymbol.js +0 -0
- /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/v6/EntitiesParser.js +0 -0
- /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/v6/OptionsBuilder.js +0 -0
- /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/v6/OutputBuilders/BaseOutputBuilder.js +0 -0
- /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/v6/OutputBuilders/JsArrBuilder.js +0 -0
- /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/v6/OutputBuilders/JsMinArrBuilder.js +0 -0
- /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/v6/OutputBuilders/JsObjBuilder.js +0 -0
- /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/v6/OutputBuilders/ParserOptionsBuilder.js +0 -0
- /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/v6/Report.js +0 -0
- /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/v6/TagPath.js +0 -0
- /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/v6/TagPathMatcher.js +0 -0
- /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/v6/XMLParser.js +0 -0
- /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/v6/Xml2JsParser.js +0 -0
- /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/v6/XmlPartReader.js +0 -0
- /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/v6/XmlSpecialTagsReader.js +0 -0
- /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/v6/inputSource/BufferSource.js +0 -0
- /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/v6/inputSource/StringSource.js +0 -0
- /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/v6/valueParsers/EntitiesParser.js +0 -0
- /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/v6/valueParsers/booleanParser.js +0 -0
- /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/v6/valueParsers/booleanParserExt.js +0 -0
- /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/v6/valueParsers/currency.js +0 -0
- /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/v6/valueParsers/join.js +0 -0
- /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/v6/valueParsers/number.js +0 -0
- /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/v6/valueParsers/trim.js +0 -0
- /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/validator.js +0 -0
- /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/xmlbuilder/json2xml.js +0 -0
- /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/xmlparser/xmlNode.js +0 -0
- /package/node_modules/{strnum → @aws-sdk/xml-builder/node_modules/strnum}/.github/SECURITY.md +0 -0
- /package/node_modules/{strnum → @aws-sdk/xml-builder/node_modules/strnum}/.vscode/launch.json +0 -0
- /package/node_modules/{strnum → @aws-sdk/xml-builder/node_modules/strnum}/LICENSE +0 -0
- /package/node_modules/{strnum → @aws-sdk/xml-builder/node_modules/strnum}/README.md +0 -0
- /package/node_modules/{strnum → @aws-sdk/xml-builder/node_modules/strnum}/algo.stflow +0 -0
- /package/node_modules/{strnum → @aws-sdk/xml-builder/node_modules/strnum}/tests/infinity_test.js +0 -0
|
@@ -0,0 +1,518 @@
|
|
|
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
|
+
/**
|
|
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
|
+
* ```typescript
|
|
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
|
+
export 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
|
+
* Create a snapshot of current state
|
|
304
|
+
* @returns State snapshot that can be restored later
|
|
305
|
+
*/
|
|
306
|
+
snapshot(): MatcherSnapshot;
|
|
307
|
+
|
|
308
|
+
// ── Blocked mutating methods ────────────────────────────────────────────────
|
|
309
|
+
// These are present in the type so callers get a compile-time error with a
|
|
310
|
+
// helpful message instead of a silent "property does not exist" error.
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* @throws {TypeError} Always – mutation is not allowed on a read-only view.
|
|
314
|
+
*/
|
|
315
|
+
push(tagName: string, attrValues?: Record<string, any> | null, namespace?: string | null): never;
|
|
316
|
+
|
|
317
|
+
/**
|
|
318
|
+
* @throws {TypeError} Always – mutation is not allowed on a read-only view.
|
|
319
|
+
*/
|
|
320
|
+
pop(): never;
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* @throws {TypeError} Always – mutation is not allowed on a read-only view.
|
|
324
|
+
*/
|
|
325
|
+
updateCurrent(attrValues: Record<string, any>): never;
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* @throws {TypeError} Always – mutation is not allowed on a read-only view.
|
|
329
|
+
*/
|
|
330
|
+
reset(): never;
|
|
331
|
+
|
|
332
|
+
/**
|
|
333
|
+
* @throws {TypeError} Always – mutation is not allowed on a read-only view.
|
|
334
|
+
*/
|
|
335
|
+
restore(snapshot: MatcherSnapshot): never;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
/**
|
|
339
|
+
* Matcher - Tracks current path in XML/JSON tree and matches against Expressions
|
|
340
|
+
*
|
|
341
|
+
* The matcher maintains a stack of nodes representing the current path from root to
|
|
342
|
+
* current tag. It only stores attribute values for the current (top) node to minimize
|
|
343
|
+
* memory usage.
|
|
344
|
+
*
|
|
345
|
+
* @example
|
|
346
|
+
* ```typescript
|
|
347
|
+
* const matcher = new Matcher();
|
|
348
|
+
* matcher.push("root", {});
|
|
349
|
+
* matcher.push("users", {});
|
|
350
|
+
* matcher.push("user", { id: "123", type: "admin" });
|
|
351
|
+
*
|
|
352
|
+
* const expr = new Expression("root.users.user");
|
|
353
|
+
* matcher.matches(expr); // true
|
|
354
|
+
*
|
|
355
|
+
* matcher.pop();
|
|
356
|
+
* matcher.matches(expr); // false
|
|
357
|
+
* ```
|
|
358
|
+
*/
|
|
359
|
+
export class Matcher {
|
|
360
|
+
/**
|
|
361
|
+
* Default path separator
|
|
362
|
+
*/
|
|
363
|
+
readonly separator: string;
|
|
364
|
+
|
|
365
|
+
/**
|
|
366
|
+
* Current path stack
|
|
367
|
+
*/
|
|
368
|
+
readonly path: PathNode[];
|
|
369
|
+
|
|
370
|
+
/**
|
|
371
|
+
* Create a new Matcher
|
|
372
|
+
* @param options - Configuration options
|
|
373
|
+
*/
|
|
374
|
+
constructor(options?: MatcherOptions);
|
|
375
|
+
|
|
376
|
+
/**
|
|
377
|
+
* Push a new tag onto the path
|
|
378
|
+
* @param tagName - Name of the tag
|
|
379
|
+
* @param attrValues - Attribute key-value pairs for current node (optional)
|
|
380
|
+
* @param namespace - Namespace for the tag (optional)
|
|
381
|
+
*
|
|
382
|
+
* @example
|
|
383
|
+
* ```typescript
|
|
384
|
+
* matcher.push("user", { id: "123", type: "admin" });
|
|
385
|
+
* matcher.push("user", { id: "456" }, "ns");
|
|
386
|
+
* matcher.push("container", null);
|
|
387
|
+
* ```
|
|
388
|
+
*/
|
|
389
|
+
push(tagName: string, attrValues?: Record<string, any> | null, namespace?: string | null): void;
|
|
390
|
+
|
|
391
|
+
/**
|
|
392
|
+
* Pop the last tag from the path
|
|
393
|
+
* @returns The popped node or undefined if path is empty
|
|
394
|
+
*/
|
|
395
|
+
pop(): PathNode | undefined;
|
|
396
|
+
|
|
397
|
+
/**
|
|
398
|
+
* Update current node's attribute values
|
|
399
|
+
* Useful when attributes are parsed after push
|
|
400
|
+
* @param attrValues - Attribute values
|
|
401
|
+
*/
|
|
402
|
+
updateCurrent(attrValues: Record<string, any>): void;
|
|
403
|
+
|
|
404
|
+
/**
|
|
405
|
+
* Get current tag name
|
|
406
|
+
* @returns Current tag name or undefined if path is empty
|
|
407
|
+
*/
|
|
408
|
+
getCurrentTag(): string | undefined;
|
|
409
|
+
|
|
410
|
+
/**
|
|
411
|
+
* Get current namespace
|
|
412
|
+
* @returns Current namespace or undefined if not present or path is empty
|
|
413
|
+
*/
|
|
414
|
+
getCurrentNamespace(): string | undefined;
|
|
415
|
+
|
|
416
|
+
/**
|
|
417
|
+
* Get current node's attribute value
|
|
418
|
+
* @param attrName - Attribute name
|
|
419
|
+
* @returns Attribute value or undefined
|
|
420
|
+
*/
|
|
421
|
+
getAttrValue(attrName: string): any;
|
|
422
|
+
|
|
423
|
+
/**
|
|
424
|
+
* Check if current node has an attribute
|
|
425
|
+
* @param attrName - Attribute name
|
|
426
|
+
*/
|
|
427
|
+
hasAttr(attrName: string): boolean;
|
|
428
|
+
|
|
429
|
+
/**
|
|
430
|
+
* Get current node's sibling position (child index in parent)
|
|
431
|
+
* @returns Position index or -1 if path is empty
|
|
432
|
+
*/
|
|
433
|
+
getPosition(): number;
|
|
434
|
+
|
|
435
|
+
/**
|
|
436
|
+
* Get current node's repeat counter (occurrence count of this tag name)
|
|
437
|
+
* @returns Counter value or -1 if path is empty
|
|
438
|
+
*/
|
|
439
|
+
getCounter(): number;
|
|
440
|
+
|
|
441
|
+
/**
|
|
442
|
+
* Get current node's sibling index (alias for getPosition for backward compatibility)
|
|
443
|
+
* @returns Index or -1 if path is empty
|
|
444
|
+
* @deprecated Use getPosition() or getCounter() instead
|
|
445
|
+
*/
|
|
446
|
+
getIndex(): number;
|
|
447
|
+
|
|
448
|
+
/**
|
|
449
|
+
* Get current path depth
|
|
450
|
+
* @returns Number of nodes in the path
|
|
451
|
+
*/
|
|
452
|
+
getDepth(): number;
|
|
453
|
+
|
|
454
|
+
/**
|
|
455
|
+
* Get path as string
|
|
456
|
+
* @param separator - Optional separator (uses default if not provided)
|
|
457
|
+
* @param includeNamespace - Whether to include namespace in output
|
|
458
|
+
* @returns Path string (e.g., "root.users.user" or "ns:root.ns:users.user")
|
|
459
|
+
*/
|
|
460
|
+
toString(separator?: string, includeNamespace?: boolean): string;
|
|
461
|
+
|
|
462
|
+
/**
|
|
463
|
+
* Get path as array of tag names
|
|
464
|
+
* @returns Array of tag names
|
|
465
|
+
*/
|
|
466
|
+
toArray(): string[];
|
|
467
|
+
|
|
468
|
+
/**
|
|
469
|
+
* Reset the path to empty
|
|
470
|
+
*/
|
|
471
|
+
reset(): void;
|
|
472
|
+
|
|
473
|
+
/**
|
|
474
|
+
* Match current path against an Expression
|
|
475
|
+
* @param expression - The expression to match against
|
|
476
|
+
* @returns True if current path matches the expression
|
|
477
|
+
*
|
|
478
|
+
* @example
|
|
479
|
+
* ```typescript
|
|
480
|
+
* const expr = new Expression("root.users.user[id]");
|
|
481
|
+
* const matcher = new Matcher();
|
|
482
|
+
*
|
|
483
|
+
* matcher.push("root");
|
|
484
|
+
* matcher.push("users");
|
|
485
|
+
* matcher.push("user", { id: "123" });
|
|
486
|
+
*
|
|
487
|
+
* matcher.matches(expr); // true
|
|
488
|
+
* ```
|
|
489
|
+
*/
|
|
490
|
+
matches(expression: Expression): boolean;
|
|
491
|
+
|
|
492
|
+
/**
|
|
493
|
+
* Create a snapshot of current state
|
|
494
|
+
* @returns State snapshot that can be restored later
|
|
495
|
+
*/
|
|
496
|
+
snapshot(): MatcherSnapshot;
|
|
497
|
+
|
|
498
|
+
/**
|
|
499
|
+
* Restore state from snapshot
|
|
500
|
+
* @param snapshot - State snapshot from previous snapshot() call
|
|
501
|
+
*/
|
|
502
|
+
restore(snapshot: MatcherSnapshot): void;
|
|
503
|
+
|
|
504
|
+
/**
|
|
505
|
+
* Return a read-only view of this matcher.
|
|
506
|
+
*/
|
|
507
|
+
readOnly(): ReadOnlyMatcher;
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
/**
|
|
511
|
+
* Default export containing both Expression and Matcher
|
|
512
|
+
*/
|
|
513
|
+
declare const _default: {
|
|
514
|
+
Expression: typeof Expression;
|
|
515
|
+
Matcher: typeof Matcher;
|
|
516
|
+
};
|
|
517
|
+
|
|
518
|
+
export default _default;
|
|
@@ -0,0 +1,28 @@
|
|
|
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
|
+
|
|
27
|
+
export { Expression, Matcher };
|
|
28
|
+
export default { Expression, Matcher };
|
package/package.json
CHANGED
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"cdklabs-projen-project-types": "^0.3.7",
|
|
89
89
|
"commit-and-tag-version": "^12",
|
|
90
90
|
"constructs": "10.0.5",
|
|
91
|
-
"esbuild": "^0.27.
|
|
91
|
+
"esbuild": "^0.27.4",
|
|
92
92
|
"eslint": "^9",
|
|
93
93
|
"eslint-import-resolver-typescript": "^3.10.1",
|
|
94
94
|
"eslint-plugin-import": "^2.32.0",
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
"jsii-diff": "^1.127.0",
|
|
99
99
|
"jsii-docgen": "^10.5.0",
|
|
100
100
|
"jsii-pacmak": "^1.127.0",
|
|
101
|
-
"jsii-rosetta": "^5.9.
|
|
101
|
+
"jsii-rosetta": "^5.9.36",
|
|
102
102
|
"lambda-tester": "^4.0.1",
|
|
103
103
|
"projen": "0.98.34",
|
|
104
104
|
"ts-jest": "^27",
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
"constructs": "^10.0.5"
|
|
111
111
|
},
|
|
112
112
|
"dependencies": {
|
|
113
|
-
"@aws-sdk/client-codedeploy": "^3.
|
|
113
|
+
"@aws-sdk/client-codedeploy": "^3.1014.0",
|
|
114
114
|
"jmespath": "^0.16.0"
|
|
115
115
|
},
|
|
116
116
|
"bundledDependencies": [
|
|
@@ -128,7 +128,7 @@
|
|
|
128
128
|
"publishConfig": {
|
|
129
129
|
"access": "public"
|
|
130
130
|
},
|
|
131
|
-
"version": "0.0.
|
|
131
|
+
"version": "0.0.434",
|
|
132
132
|
"jest": {
|
|
133
133
|
"coverageProvider": "v8",
|
|
134
134
|
"testMatch": [
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { join, normalize, sep } from "node:path";
|
|
2
|
-
const typescriptPackageJsonPath = join("node_modules", "typescript", "package.json");
|
|
3
|
-
export const getTypeScriptPackageJsonPaths = (dirname) => {
|
|
4
|
-
const cwdPath = join(process.cwd(), typescriptPackageJsonPath);
|
|
5
|
-
if (!dirname) {
|
|
6
|
-
return [cwdPath];
|
|
7
|
-
}
|
|
8
|
-
const normalizedPath = normalize(dirname);
|
|
9
|
-
const parts = normalizedPath.split(sep);
|
|
10
|
-
const nodeModulesIndex = parts.indexOf("node_modules");
|
|
11
|
-
const parentDir = nodeModulesIndex !== -1 ? parts.slice(0, nodeModulesIndex).join(sep) : dirname;
|
|
12
|
-
const parentDirPath = join(parentDir, typescriptPackageJsonPath);
|
|
13
|
-
if (cwdPath === parentDirPath) {
|
|
14
|
-
return [cwdPath];
|
|
15
|
-
}
|
|
16
|
-
return [parentDirPath, cwdPath];
|
|
17
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(()=>{"use strict";var t={d:(e,i)=>{for(var s in i)t.o(i,s)&&!t.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:i[s]})},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={};function i(t,e){let i="";return e.format&&e.indentBy.length>0&&(i="\n"),s(t,e,"",i)}function s(t,e,i,p){let u="",h=!1;if(!Array.isArray(t)){if(null!=t){let i=t.toString();return i=a(i,e),i}return""}for(let l=0;l<t.length;l++){const d=t[l],c=n(d);if(void 0===c)continue;let f="";if(f=0===i.length?c:`${i}.${c}`,c===e.textNodeName){let t=d[c];r(f,e)||(t=e.tagValueProcessor(c,t),t=a(t,e)),h&&(u+=p),u+=t,h=!1;continue}if(c===e.cdataPropName){h&&(u+=p),u+=`<![CDATA[${d[c][0][e.textNodeName]}]]>`,h=!1;continue}if(c===e.commentPropName){u+=p+`\x3c!--${d[c][0][e.textNodeName]}--\x3e`,h=!0;continue}if("?"===c[0]){const t=o(d[":@"],e),i="?xml"===c?"":p;let s=d[c][0][e.textNodeName];s=0!==s.length?" "+s:"",u+=i+`<${c}${s}${t}?>`,h=!0;continue}let g=p;""!==g&&(g+=e.indentBy);const N=p+`<${c}${o(d[":@"],e)}`,b=s(d[c],e,f,g);-1!==e.unpairedTags.indexOf(c)?e.suppressUnpairedNode?u+=N+">":u+=N+"/>":b&&0!==b.length||!e.suppressEmptyNode?b&&b.endsWith(">")?u+=N+`>${b}${p}</${c}>`:(u+=N+">",b&&""!==p&&(b.includes("/>")||b.includes("</"))?u+=p+e.indentBy+b+p:u+=b,u+=`</${c}>`):u+=N+"/>",h=!0}return u}function n(t){const e=Object.keys(t);for(let i=0;i<e.length;i++){const s=e[i];if(Object.prototype.hasOwnProperty.call(t,s)&&":@"!==s)return s}}function o(t,e){let i="";if(t&&!e.ignoreAttributes)for(let s in t){if(!Object.prototype.hasOwnProperty.call(t,s))continue;let n=e.attributeValueProcessor(s,t[s]);n=a(n,e),!0===n&&e.suppressBooleanAttributes?i+=` ${s.substr(e.attributeNamePrefix.length)}`:i+=` ${s.substr(e.attributeNamePrefix.length)}="${n}"`}return i}function r(t,e){let i=(t=t.substr(0,t.length-e.textNodeName.length-1)).substr(t.lastIndexOf(".")+1);for(let s in e.stopNodes)if(e.stopNodes[s]===t||e.stopNodes[s]==="*."+i)return!0;return!1}function a(t,e){if(t&&t.length>0&&e.processEntities)for(let i=0;i<e.entities.length;i++){const s=e.entities[i];t=t.replace(s.regex,s.val)}return t}t.r(e),t.d(e,{default:()=>u});const p={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&"},{regex:new RegExp(">","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1};function u(t){var e;this.options=Object.assign({},p,t),!0===this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn="function"==typeof(e=this.options.ignoreAttributes)?e:Array.isArray(e)?t=>{for(const i of e){if("string"==typeof i&&t===i)return!0;if(i instanceof RegExp&&i.test(t))return!0}}:()=>!1,this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=d),this.processTextOrObjNode=h,this.options.format?(this.indentate=l,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function h(t,e,i,s){const n=this.j2x(t,i+1,s.concat(e));return void 0!==t[this.options.textNodeName]&&1===Object.keys(t).length?this.buildTextValNode(t[this.options.textNodeName],e,n.attrStr,i):this.buildObjectNode(n.val,e,n.attrStr,i)}function l(t){return this.options.indentBy.repeat(t)}function d(t){return!(!t.startsWith(this.options.attributeNamePrefix)||t===this.options.textNodeName)&&t.substr(this.attrPrefixLen)}u.prototype.build=function(t){return this.options.preserveOrder?i(t,this.options):(Array.isArray(t)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(t={[this.options.arrayNodeName]:t}),this.j2x(t,0,[]).val)},u.prototype.j2x=function(t,e,i){let s="",n="";const o=i.join(".");for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r))if(void 0===t[r])this.isAttribute(r)&&(n+="");else if(null===t[r])this.isAttribute(r)||r===this.options.cdataPropName?n+="":"?"===r[0]?n+=this.indentate(e)+"<"+r+"?"+this.tagEndChar:n+=this.indentate(e)+"<"+r+"/"+this.tagEndChar;else if(t[r]instanceof Date)n+=this.buildTextValNode(t[r],r,"",e);else if("object"!=typeof t[r]){const i=this.isAttribute(r);if(i&&!this.ignoreAttributesFn(i,o))s+=this.buildAttrPairStr(i,""+t[r]);else if(!i)if(r===this.options.textNodeName){let e=this.options.tagValueProcessor(r,""+t[r]);n+=this.replaceEntitiesValue(e)}else n+=this.buildTextValNode(t[r],r,"",e)}else if(Array.isArray(t[r])){const s=t[r].length;let o="",a="";for(let p=0;p<s;p++){const s=t[r][p];if(void 0===s);else if(null===s)"?"===r[0]?n+=this.indentate(e)+"<"+r+"?"+this.tagEndChar:n+=this.indentate(e)+"<"+r+"/"+this.tagEndChar;else if("object"==typeof s)if(this.options.oneListGroup){const t=this.j2x(s,e+1,i.concat(r));o+=t.val,this.options.attributesGroupName&&s.hasOwnProperty(this.options.attributesGroupName)&&(a+=t.attrStr)}else o+=this.processTextOrObjNode(s,r,e,i);else if(this.options.oneListGroup){let t=this.options.tagValueProcessor(r,s);t=this.replaceEntitiesValue(t),o+=t}else o+=this.buildTextValNode(s,r,"",e)}this.options.oneListGroup&&(o=this.buildObjectNode(o,r,a,e)),n+=o}else if(this.options.attributesGroupName&&r===this.options.attributesGroupName){const e=Object.keys(t[r]),i=e.length;for(let n=0;n<i;n++)s+=this.buildAttrPairStr(e[n],""+t[r][e[n]])}else n+=this.processTextOrObjNode(t[r],r,e,i);return{attrStr:s,val:n}},u.prototype.buildAttrPairStr=function(t,e){return e=this.options.attributeValueProcessor(t,""+e),e=this.replaceEntitiesValue(e),this.options.suppressBooleanAttributes&&"true"===e?" "+t:" "+t+'="'+e+'"'},u.prototype.buildObjectNode=function(t,e,i,s){if(""===t)return"?"===e[0]?this.indentate(s)+"<"+e+i+"?"+this.tagEndChar:this.indentate(s)+"<"+e+i+this.closeTag(e)+this.tagEndChar;{let n="</"+e+this.tagEndChar,o="";return"?"===e[0]&&(o="?",n=""),!i&&""!==i||-1!==t.indexOf("<")?!1!==this.options.commentPropName&&e===this.options.commentPropName&&0===o.length?this.indentate(s)+`\x3c!--${t}--\x3e`+this.newLine:this.indentate(s)+"<"+e+i+o+this.tagEndChar+t+this.indentate(s)+n:this.indentate(s)+"<"+e+i+o+">"+t+n}},u.prototype.closeTag=function(t){let e="";return-1!==this.options.unpairedTags.indexOf(t)?this.options.suppressUnpairedNode||(e="/"):e=this.options.suppressEmptyNode?"/":`></${t}`,e},u.prototype.buildTextValNode=function(t,e,i,s){if(!1!==this.options.cdataPropName&&e===this.options.cdataPropName)return this.indentate(s)+`<![CDATA[${t}]]>`+this.newLine;if(!1!==this.options.commentPropName&&e===this.options.commentPropName)return this.indentate(s)+`\x3c!--${t}--\x3e`+this.newLine;if("?"===e[0])return this.indentate(s)+"<"+e+i+"?"+this.tagEndChar;{let n=this.options.tagValueProcessor(e,t);return n=this.replaceEntitiesValue(n),""===n?this.indentate(s)+"<"+e+i+this.closeTag(e)+this.tagEndChar:this.indentate(s)+"<"+e+i+">"+n+"</"+e+this.tagEndChar}},u.prototype.replaceEntitiesValue=function(t){if(t&&t.length>0&&this.options.processEntities)for(let e=0;e<this.options.entities.length;e++){const i=this.options.entities[e];t=t.replace(i.regex,i.val)}return t},module.exports=e})();
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.fxpBuilder=e():t.fxpBuilder=e()}(this,()=>(()=>{"use strict";var t={d:(e,r)=>{for(var i in r)t.o(r,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:r[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={};function r(t,e){var r="";return e.format&&e.indentBy.length>0&&(r="\n"),i(t,e,"",r)}function i(t,e,r,u){var p="",h=!1;if(!Array.isArray(t)){if(null!=t){var l=t.toString();return a(l,e)}return""}for(var d=0;d<t.length;d++){var f=t[d],c=n(f);if(void 0!==c){var g;if(g=0===r.length?c:r+"."+c,c!==e.textNodeName)if(c!==e.cdataPropName)if(c!==e.commentPropName)if("?"!==c[0]){var b=u;""!==b&&(b+=e.indentBy);var m=u+"<"+c+o(f[":@"],e),v=i(f[c],e,g,b);-1!==e.unpairedTags.indexOf(c)?e.suppressUnpairedNode?p+=m+">":p+=m+"/>":v&&0!==v.length||!e.suppressEmptyNode?v&&v.endsWith(">")?p+=m+">"+v+u+"</"+c+">":(p+=m+">",v&&""!==u&&(v.includes("/>")||v.includes("</"))?p+=u+e.indentBy+v+u:p+=v,p+="</"+c+">"):p+=m+"/>",h=!0}else{var N=o(f[":@"],e),y="?xml"===c?"":u,x=f[c][0][e.textNodeName];p+=y+"<"+c+(x=0!==x.length?" "+x:"")+N+"?>",h=!0}else p+=u+"\x3c!--"+f[c][0][e.textNodeName]+"--\x3e",h=!0;else h&&(p+=u),p+="<![CDATA["+f[c][0][e.textNodeName]+"]]>",h=!1;else{var P=f[c];s(g,e)||(P=a(P=e.tagValueProcessor(c,P),e)),h&&(p+=u),p+=P,h=!1}}}return p}function n(t){for(var e=Object.keys(t),r=0;r<e.length;r++){var i=e[r];if(Object.prototype.hasOwnProperty.call(t,i)&&":@"!==i)return i}}function o(t,e){var r="";if(t&&!e.ignoreAttributes)for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var n=e.attributeValueProcessor(i,t[i]);!0===(n=a(n,e))&&e.suppressBooleanAttributes?r+=" "+i.substr(e.attributeNamePrefix.length):r+=" "+i.substr(e.attributeNamePrefix.length)+'="'+n+'"'}return r}function s(t,e){var r=(t=t.substr(0,t.length-e.textNodeName.length-1)).substr(t.lastIndexOf(".")+1);for(var i in e.stopNodes)if(e.stopNodes[i]===t||e.stopNodes[i]==="*."+r)return!0;return!1}function a(t,e){if(t&&t.length>0&&e.processEntities)for(var r=0;r<e.entities.length;r++){var i=e.entities[r];t=t.replace(i.regex,i.val)}return t}function u(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,i=Array(e);r<e;r++)i[r]=t[r];return i}t.r(e),t.d(e,{default:()=>h});var p={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&"},{regex:new RegExp(">","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1};function h(t){var e;this.options=Object.assign({},p,t),!0===this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn="function"==typeof(e=this.options.ignoreAttributes)?e:Array.isArray(e)?function(t){for(var r,i=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return u(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?u(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var i=0;return function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(e);!(r=i()).done;){var n=r.value;if("string"==typeof n&&t===n)return!0;if(n instanceof RegExp&&n.test(t))return!0}}:function(){return!1},this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=f),this.processTextOrObjNode=l,this.options.format?(this.indentate=d,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function l(t,e,r,i){var n=this.j2x(t,r+1,i.concat(e));return void 0!==t[this.options.textNodeName]&&1===Object.keys(t).length?this.buildTextValNode(t[this.options.textNodeName],e,n.attrStr,r):this.buildObjectNode(n.val,e,n.attrStr,r)}function d(t){return this.options.indentBy.repeat(t)}function f(t){return!(!t.startsWith(this.options.attributeNamePrefix)||t===this.options.textNodeName)&&t.substr(this.attrPrefixLen)}return h.prototype.build=function(t){return this.options.preserveOrder?r(t,this.options):(Array.isArray(t)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&((e={})[this.options.arrayNodeName]=t,t=e),this.j2x(t,0,[]).val);var e},h.prototype.j2x=function(t,e,r){var i="",n="",o=r.join(".");for(var s in t)if(Object.prototype.hasOwnProperty.call(t,s))if(void 0===t[s])this.isAttribute(s)&&(n+="");else if(null===t[s])this.isAttribute(s)||s===this.options.cdataPropName?n+="":"?"===s[0]?n+=this.indentate(e)+"<"+s+"?"+this.tagEndChar:n+=this.indentate(e)+"<"+s+"/"+this.tagEndChar;else if(t[s]instanceof Date)n+=this.buildTextValNode(t[s],s,"",e);else if("object"!=typeof t[s]){var a=this.isAttribute(s);if(a&&!this.ignoreAttributesFn(a,o))i+=this.buildAttrPairStr(a,""+t[s]);else if(!a)if(s===this.options.textNodeName){var u=this.options.tagValueProcessor(s,""+t[s]);n+=this.replaceEntitiesValue(u)}else n+=this.buildTextValNode(t[s],s,"",e)}else if(Array.isArray(t[s])){for(var p=t[s].length,h="",l="",d=0;d<p;d++){var f=t[s][d];if(void 0===f);else if(null===f)"?"===s[0]?n+=this.indentate(e)+"<"+s+"?"+this.tagEndChar:n+=this.indentate(e)+"<"+s+"/"+this.tagEndChar;else if("object"==typeof f)if(this.options.oneListGroup){var c=this.j2x(f,e+1,r.concat(s));h+=c.val,this.options.attributesGroupName&&f.hasOwnProperty(this.options.attributesGroupName)&&(l+=c.attrStr)}else h+=this.processTextOrObjNode(f,s,e,r);else if(this.options.oneListGroup){var g=this.options.tagValueProcessor(s,f);h+=g=this.replaceEntitiesValue(g)}else h+=this.buildTextValNode(f,s,"",e)}this.options.oneListGroup&&(h=this.buildObjectNode(h,s,l,e)),n+=h}else if(this.options.attributesGroupName&&s===this.options.attributesGroupName)for(var b=Object.keys(t[s]),m=b.length,v=0;v<m;v++)i+=this.buildAttrPairStr(b[v],""+t[s][b[v]]);else n+=this.processTextOrObjNode(t[s],s,e,r);return{attrStr:i,val:n}},h.prototype.buildAttrPairStr=function(t,e){return e=this.options.attributeValueProcessor(t,""+e),e=this.replaceEntitiesValue(e),this.options.suppressBooleanAttributes&&"true"===e?" "+t:" "+t+'="'+e+'"'},h.prototype.buildObjectNode=function(t,e,r,i){if(""===t)return"?"===e[0]?this.indentate(i)+"<"+e+r+"?"+this.tagEndChar:this.indentate(i)+"<"+e+r+this.closeTag(e)+this.tagEndChar;var n="</"+e+this.tagEndChar,o="";return"?"===e[0]&&(o="?",n=""),!r&&""!==r||-1!==t.indexOf("<")?!1!==this.options.commentPropName&&e===this.options.commentPropName&&0===o.length?this.indentate(i)+"\x3c!--"+t+"--\x3e"+this.newLine:this.indentate(i)+"<"+e+r+o+this.tagEndChar+t+this.indentate(i)+n:this.indentate(i)+"<"+e+r+o+">"+t+n},h.prototype.closeTag=function(t){var e="";return-1!==this.options.unpairedTags.indexOf(t)?this.options.suppressUnpairedNode||(e="/"):e=this.options.suppressEmptyNode?"/":"></"+t,e},h.prototype.buildTextValNode=function(t,e,r,i){if(!1!==this.options.cdataPropName&&e===this.options.cdataPropName)return this.indentate(i)+"<![CDATA["+t+"]]>"+this.newLine;if(!1!==this.options.commentPropName&&e===this.options.commentPropName)return this.indentate(i)+"\x3c!--"+t+"--\x3e"+this.newLine;if("?"===e[0])return this.indentate(i)+"<"+e+r+"?"+this.tagEndChar;var n=this.options.tagValueProcessor(e,t);return""===(n=this.replaceEntitiesValue(n))?this.indentate(i)+"<"+e+r+this.closeTag(e)+this.tagEndChar:this.indentate(i)+"<"+e+r+">"+n+"</"+e+this.tagEndChar},h.prototype.replaceEntitiesValue=function(t){if(t&&t.length>0&&this.options.processEntities)for(var e=0;e<this.options.entities.length;e++){var r=this.options.entities[e];t=t.replace(r.regex,r.val)}return t},e})());
|
|
2
|
-
//# sourceMappingURL=builder.min.js.map
|