@jjrawlins/cdk-diff-pr-github-action 1.9.0 → 1.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/.jsii +4 -4
  2. package/cdkdiffprgithubaction/CdkDiffStackWorkflowProps.go +18 -0
  3. package/cdkdiffprgithubaction/CdkDriftDetectionWorkflowProps.go +12 -0
  4. package/cdkdiffprgithubaction/README.md +29 -0
  5. package/cdkdiffprgithubaction/go.mod +1 -1
  6. package/cdkdiffprgithubaction/jsii/jsii.go +2 -2
  7. package/cdkdiffprgithubaction/version +1 -1
  8. package/lib/CdkDiffIamTemplate.js +2 -2
  9. package/lib/CdkDiffIamTemplateStackSet.js +2 -2
  10. package/lib/CdkDiffStackWorkflow.js +1 -1
  11. package/lib/CdkDriftDetectionWorkflow.js +1 -1
  12. package/lib/CdkDriftIamTemplate.js +2 -2
  13. package/node_modules/@aws-sdk/client-cloudformation/package.json +13 -13
  14. package/node_modules/@aws-sdk/core/package.json +4 -4
  15. package/node_modules/@aws-sdk/credential-provider-env/package.json +2 -2
  16. package/node_modules/@aws-sdk/credential-provider-http/package.json +6 -6
  17. package/node_modules/@aws-sdk/credential-provider-ini/package.json +9 -9
  18. package/node_modules/@aws-sdk/credential-provider-login/package.json +3 -3
  19. package/node_modules/@aws-sdk/credential-provider-node/package.json +7 -7
  20. package/node_modules/@aws-sdk/credential-provider-process/package.json +2 -2
  21. package/node_modules/@aws-sdk/credential-provider-sso/package.json +4 -4
  22. package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +3 -3
  23. package/node_modules/@aws-sdk/middleware-user-agent/package.json +3 -3
  24. package/node_modules/@aws-sdk/nested-clients/package.json +12 -12
  25. package/node_modules/@aws-sdk/token-providers/package.json +3 -3
  26. package/node_modules/@aws-sdk/util-user-agent-node/dist-cjs/index.js +36 -19
  27. package/node_modules/@aws-sdk/util-user-agent-node/dist-es/getSanitizedTypeScriptVersion.js +9 -0
  28. package/node_modules/@aws-sdk/util-user-agent-node/dist-es/getTypeScriptPackageJsonPaths.js +17 -0
  29. package/node_modules/@aws-sdk/util-user-agent-node/dist-es/getTypeScriptUserAgentPair.js +17 -12
  30. package/node_modules/@aws-sdk/util-user-agent-node/dist-types/getSanitizedTypeScriptVersion.d.ts +8 -0
  31. package/node_modules/@aws-sdk/util-user-agent-node/dist-types/getTypeScriptPackageJsonPaths.d.ts +10 -0
  32. package/node_modules/@aws-sdk/util-user-agent-node/dist-types/ts3.4/getSanitizedTypeScriptVersion.d.ts +3 -0
  33. package/node_modules/@aws-sdk/util-user-agent-node/dist-types/ts3.4/getTypeScriptPackageJsonPaths.d.ts +3 -0
  34. package/node_modules/@aws-sdk/util-user-agent-node/package.json +2 -2
  35. package/node_modules/@aws-sdk/xml-builder/dist-cjs/xml-parser.js +1 -0
  36. package/node_modules/@aws-sdk/xml-builder/dist-es/xml-parser.js +1 -0
  37. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/CHANGELOG.md +23 -0
  38. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxbuilder.min.js +1 -1
  39. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxbuilder.min.js.map +1 -1
  40. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxp.cjs +1 -1
  41. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxp.d.cts +15 -1
  42. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxp.min.js +1 -1
  43. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxp.min.js.map +1 -1
  44. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxparser.min.js +1 -1
  45. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxparser.min.js.map +1 -1
  46. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxvalidator.min.js +1 -1
  47. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxvalidator.min.js.map +1 -1
  48. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/package.json +3 -2
  49. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/fxp.d.ts +16 -0
  50. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/fxp.js +1 -1
  51. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/util.js +1 -26
  52. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/EntitiesParser.js +87 -87
  53. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/OptionsBuilder.js +10 -10
  54. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/OutputBuilders/BaseOutputBuilder.js +23 -23
  55. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsArrBuilder.js +29 -29
  56. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsObjBuilder.js +39 -39
  57. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/OutputBuilders/ParserOptionsBuilder.js +17 -17
  58. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/XMLParser.js +22 -22
  59. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/v6/valueParsers/EntitiesParser.js +85 -85
  60. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/validator.js +34 -34
  61. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js +5 -284
  62. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js +1 -1
  63. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js +2 -0
  64. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js +27 -5
  65. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/xmlparser/XMLParser.js +21 -21
  66. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/xmlparser/node2json.js +38 -34
  67. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/xmlparser/xmlNode.js +10 -10
  68. package/node_modules/@aws-sdk/xml-builder/package.json +2 -2
  69. package/node_modules/@smithy/core/dist-cjs/submodules/cbor/index.js +2 -8
  70. package/node_modules/@smithy/core/dist-es/submodules/cbor/CborCodec.js +2 -8
  71. package/node_modules/@smithy/core/package.json +2 -2
  72. package/node_modules/@smithy/fetch-http-handler/dist-cjs/index.js +18 -4
  73. package/node_modules/@smithy/fetch-http-handler/dist-es/fetch-http-handler.js +18 -4
  74. package/node_modules/@smithy/fetch-http-handler/package.json +1 -1
  75. package/node_modules/@smithy/middleware-endpoint/package.json +2 -2
  76. package/node_modules/@smithy/middleware-retry/package.json +2 -2
  77. package/node_modules/@smithy/node-http-handler/dist-cjs/index.js +21 -8
  78. package/node_modules/@smithy/node-http-handler/dist-es/build-abort-error.js +16 -0
  79. package/node_modules/@smithy/node-http-handler/dist-es/node-http-handler.js +3 -4
  80. package/node_modules/@smithy/node-http-handler/dist-es/node-http2-handler.js +3 -4
  81. package/node_modules/@smithy/node-http-handler/dist-types/build-abort-error.d.ts +9 -0
  82. package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/build-abort-error.d.ts +9 -0
  83. package/node_modules/@smithy/node-http-handler/package.json +1 -1
  84. package/node_modules/@smithy/smithy-client/package.json +4 -4
  85. package/node_modules/@smithy/util-defaults-mode-browser/package.json +2 -2
  86. package/node_modules/@smithy/util-defaults-mode-node/package.json +2 -2
  87. package/node_modules/@smithy/util-stream/package.json +3 -3
  88. package/node_modules/fast-xml-builder/LICENSE +21 -0
  89. package/node_modules/fast-xml-builder/README.md +23 -0
  90. package/node_modules/fast-xml-builder/lib/builder.cjs +1 -0
  91. package/node_modules/fast-xml-builder/lib/builder.min.js +2 -0
  92. package/node_modules/fast-xml-builder/lib/builder.min.js.map +1 -0
  93. package/node_modules/fast-xml-builder/lib/fxb.d.cts +167 -0
  94. package/node_modules/fast-xml-builder/package.json +78 -0
  95. package/node_modules/fast-xml-builder/src/fxb.d.ts +156 -0
  96. package/node_modules/fast-xml-builder/src/fxb.js +285 -0
  97. package/node_modules/fast-xml-builder/src/ignoreAttributes.js +18 -0
  98. package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/xmlbuilder → fast-xml-builder/src}/orderedJs2Xml.js +14 -3
  99. package/node_modules/fast-xml-builder/src/prettifyJs2Xml.js +0 -0
  100. package/package.json +2 -2
  101. package/node_modules/@aws-sdk/util-user-agent-node/dist-es/getTypeScriptPackageJsonPath.js +0 -14
  102. package/node_modules/@aws-sdk/util-user-agent-node/dist-types/getTypeScriptPackageJsonPath.d.ts +0 -9
  103. package/node_modules/@aws-sdk/util-user-agent-node/dist-types/ts3.4/getTypeScriptPackageJsonPath.d.ts +0 -1
  104. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/xmlbuilder/prettifyJs2Xml.js → fast-xml-builder/CHANGELOG.md} +0 -0
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/credential-provider-login",
3
- "version": "3.972.13",
3
+ "version": "3.972.14",
4
4
  "description": "AWS credential provider that sources credentials from aws login cached tokens",
5
5
  "main": "./dist-cjs/index.js",
6
6
  "module": "./dist-es/index.js",
@@ -28,8 +28,8 @@
28
28
  },
29
29
  "license": "Apache-2.0",
30
30
  "dependencies": {
31
- "@aws-sdk/core": "^3.973.15",
32
- "@aws-sdk/nested-clients": "^3.996.3",
31
+ "@aws-sdk/core": "^3.973.16",
32
+ "@aws-sdk/nested-clients": "^3.996.4",
33
33
  "@aws-sdk/types": "^3.973.4",
34
34
  "@smithy/property-provider": "^4.2.10",
35
35
  "@smithy/protocol-http": "^5.3.10",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/credential-provider-node",
3
- "version": "3.972.14",
3
+ "version": "3.972.15",
4
4
  "description": "AWS credential provider that sources credentials from a Node.JS environment. ",
5
5
  "engines": {
6
6
  "node": ">=20.0.0"
@@ -31,12 +31,12 @@
31
31
  },
32
32
  "license": "Apache-2.0",
33
33
  "dependencies": {
34
- "@aws-sdk/credential-provider-env": "^3.972.13",
35
- "@aws-sdk/credential-provider-http": "^3.972.15",
36
- "@aws-sdk/credential-provider-ini": "^3.972.13",
37
- "@aws-sdk/credential-provider-process": "^3.972.13",
38
- "@aws-sdk/credential-provider-sso": "^3.972.13",
39
- "@aws-sdk/credential-provider-web-identity": "^3.972.13",
34
+ "@aws-sdk/credential-provider-env": "^3.972.14",
35
+ "@aws-sdk/credential-provider-http": "^3.972.16",
36
+ "@aws-sdk/credential-provider-ini": "^3.972.14",
37
+ "@aws-sdk/credential-provider-process": "^3.972.14",
38
+ "@aws-sdk/credential-provider-sso": "^3.972.14",
39
+ "@aws-sdk/credential-provider-web-identity": "^3.972.14",
40
40
  "@aws-sdk/types": "^3.973.4",
41
41
  "@smithy/credential-provider-imds": "^4.2.10",
42
42
  "@smithy/property-provider": "^4.2.10",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/credential-provider-process",
3
- "version": "3.972.13",
3
+ "version": "3.972.14",
4
4
  "description": "AWS credential provider that sources credential_process from ~/.aws/credentials and ~/.aws/config",
5
5
  "main": "./dist-cjs/index.js",
6
6
  "module": "./dist-es/index.js",
@@ -26,7 +26,7 @@
26
26
  },
27
27
  "license": "Apache-2.0",
28
28
  "dependencies": {
29
- "@aws-sdk/core": "^3.973.15",
29
+ "@aws-sdk/core": "^3.973.16",
30
30
  "@aws-sdk/types": "^3.973.4",
31
31
  "@smithy/property-provider": "^4.2.10",
32
32
  "@smithy/shared-ini-file-loader": "^4.4.5",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/credential-provider-sso",
3
- "version": "3.972.13",
3
+ "version": "3.972.14",
4
4
  "description": "AWS credential provider that exchanges a resolved SSO login token file for temporary AWS credentials",
5
5
  "main": "./dist-cjs/index.js",
6
6
  "module": "./dist-es/index.js",
@@ -26,9 +26,9 @@
26
26
  },
27
27
  "license": "Apache-2.0",
28
28
  "dependencies": {
29
- "@aws-sdk/core": "^3.973.15",
30
- "@aws-sdk/nested-clients": "^3.996.3",
31
- "@aws-sdk/token-providers": "3.999.0",
29
+ "@aws-sdk/core": "^3.973.16",
30
+ "@aws-sdk/nested-clients": "^3.996.4",
31
+ "@aws-sdk/token-providers": "3.1001.0",
32
32
  "@aws-sdk/types": "^3.973.4",
33
33
  "@smithy/property-provider": "^4.2.10",
34
34
  "@smithy/shared-ini-file-loader": "^4.4.5",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/credential-provider-web-identity",
3
- "version": "3.972.13",
3
+ "version": "3.972.14",
4
4
  "description": "AWS credential provider that calls STS assumeRole for temporary AWS credentials",
5
5
  "main": "./dist-cjs/index.js",
6
6
  "module": "./dist-es/index.js",
@@ -34,8 +34,8 @@
34
34
  },
35
35
  "license": "Apache-2.0",
36
36
  "dependencies": {
37
- "@aws-sdk/core": "^3.973.15",
38
- "@aws-sdk/nested-clients": "^3.996.3",
37
+ "@aws-sdk/core": "^3.973.16",
38
+ "@aws-sdk/nested-clients": "^3.996.4",
39
39
  "@aws-sdk/types": "^3.973.4",
40
40
  "@smithy/property-provider": "^4.2.10",
41
41
  "@smithy/shared-ini-file-loader": "^4.4.5",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/middleware-user-agent",
3
- "version": "3.972.15",
3
+ "version": "3.972.16",
4
4
  "scripts": {
5
5
  "build": "concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs",
6
6
  "build:cjs": "node ../../scripts/compilation/inline middleware-user-agent",
@@ -25,10 +25,10 @@
25
25
  },
26
26
  "license": "Apache-2.0",
27
27
  "dependencies": {
28
- "@aws-sdk/core": "^3.973.15",
28
+ "@aws-sdk/core": "^3.973.16",
29
29
  "@aws-sdk/types": "^3.973.4",
30
30
  "@aws-sdk/util-endpoints": "^3.996.3",
31
- "@smithy/core": "^3.23.6",
31
+ "@smithy/core": "^3.23.7",
32
32
  "@smithy/protocol-http": "^5.3.10",
33
33
  "@smithy/types": "^4.13.0",
34
34
  "tslib": "^2.6.2"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/nested-clients",
3
- "version": "3.996.3",
3
+ "version": "3.996.4",
4
4
  "description": "Nested clients for AWS SDK packages.",
5
5
  "main": "./dist-cjs/index.js",
6
6
  "module": "./dist-es/index.js",
@@ -29,37 +29,37 @@
29
29
  "dependencies": {
30
30
  "@aws-crypto/sha256-browser": "5.2.0",
31
31
  "@aws-crypto/sha256-js": "5.2.0",
32
- "@aws-sdk/core": "^3.973.15",
32
+ "@aws-sdk/core": "^3.973.16",
33
33
  "@aws-sdk/middleware-host-header": "^3.972.6",
34
34
  "@aws-sdk/middleware-logger": "^3.972.6",
35
35
  "@aws-sdk/middleware-recursion-detection": "^3.972.6",
36
- "@aws-sdk/middleware-user-agent": "^3.972.15",
36
+ "@aws-sdk/middleware-user-agent": "^3.972.16",
37
37
  "@aws-sdk/region-config-resolver": "^3.972.6",
38
38
  "@aws-sdk/types": "^3.973.4",
39
39
  "@aws-sdk/util-endpoints": "^3.996.3",
40
40
  "@aws-sdk/util-user-agent-browser": "^3.972.6",
41
- "@aws-sdk/util-user-agent-node": "^3.973.0",
41
+ "@aws-sdk/util-user-agent-node": "^3.973.1",
42
42
  "@smithy/config-resolver": "^4.4.9",
43
- "@smithy/core": "^3.23.6",
44
- "@smithy/fetch-http-handler": "^5.3.11",
43
+ "@smithy/core": "^3.23.7",
44
+ "@smithy/fetch-http-handler": "^5.3.12",
45
45
  "@smithy/hash-node": "^4.2.10",
46
46
  "@smithy/invalid-dependency": "^4.2.10",
47
47
  "@smithy/middleware-content-length": "^4.2.10",
48
- "@smithy/middleware-endpoint": "^4.4.20",
49
- "@smithy/middleware-retry": "^4.4.37",
48
+ "@smithy/middleware-endpoint": "^4.4.21",
49
+ "@smithy/middleware-retry": "^4.4.38",
50
50
  "@smithy/middleware-serde": "^4.2.11",
51
51
  "@smithy/middleware-stack": "^4.2.10",
52
52
  "@smithy/node-config-provider": "^4.3.10",
53
- "@smithy/node-http-handler": "^4.4.12",
53
+ "@smithy/node-http-handler": "^4.4.13",
54
54
  "@smithy/protocol-http": "^5.3.10",
55
- "@smithy/smithy-client": "^4.12.0",
55
+ "@smithy/smithy-client": "^4.12.1",
56
56
  "@smithy/types": "^4.13.0",
57
57
  "@smithy/url-parser": "^4.2.10",
58
58
  "@smithy/util-base64": "^4.3.1",
59
59
  "@smithy/util-body-length-browser": "^4.2.1",
60
60
  "@smithy/util-body-length-node": "^4.2.2",
61
- "@smithy/util-defaults-mode-browser": "^4.3.36",
62
- "@smithy/util-defaults-mode-node": "^4.2.39",
61
+ "@smithy/util-defaults-mode-browser": "^4.3.37",
62
+ "@smithy/util-defaults-mode-node": "^4.2.40",
63
63
  "@smithy/util-endpoints": "^3.3.1",
64
64
  "@smithy/util-middleware": "^4.2.10",
65
65
  "@smithy/util-retry": "^4.2.10",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/token-providers",
3
- "version": "3.999.0",
3
+ "version": "3.1001.0",
4
4
  "description": "A collection of token providers",
5
5
  "main": "./dist-cjs/index.js",
6
6
  "module": "./dist-es/index.js",
@@ -29,8 +29,8 @@
29
29
  },
30
30
  "license": "Apache-2.0",
31
31
  "dependencies": {
32
- "@aws-sdk/core": "^3.973.15",
33
- "@aws-sdk/nested-clients": "^3.996.3",
32
+ "@aws-sdk/core": "^3.973.16",
33
+ "@aws-sdk/nested-clients": "^3.996.4",
34
34
  "@aws-sdk/types": "^3.973.4",
35
35
  "@smithy/property-provider": "^4.2.10",
36
36
  "@smithy/shared-ini-file-loader": "^4.4.5",
@@ -16,18 +16,31 @@ const getRuntimeUserAgentPair = () => {
16
16
  return ["md/nodejs", node_process.versions.node];
17
17
  };
18
18
 
19
- const getTypeScriptPackageJsonPath = (dirname = "") => {
20
- let nodeModulesPath;
19
+ const SEMVER_REGEX = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*)?$/;
20
+ const getSanitizedTypeScriptVersion = (version = "") => {
21
+ const match = version.match(SEMVER_REGEX);
22
+ if (!match) {
23
+ return undefined;
24
+ }
25
+ const [major, minor, patch, prerelease] = [match[1], match[2], match[3], match[4]];
26
+ return prerelease ? `${major}.${minor}.${patch}-${prerelease}` : `${major}.${minor}.${patch}`;
27
+ };
28
+
29
+ const typescriptPackageJsonPath = node_path.join("node_modules", "typescript", "package.json");
30
+ const getTypeScriptPackageJsonPaths = (dirname) => {
31
+ const cwdPath = node_path.join(process.cwd(), typescriptPackageJsonPath);
32
+ if (!dirname) {
33
+ return [cwdPath];
34
+ }
21
35
  const normalizedPath = node_path.normalize(dirname);
22
36
  const parts = normalizedPath.split(node_path.sep);
23
37
  const nodeModulesIndex = parts.indexOf("node_modules");
24
- if (nodeModulesIndex !== -1) {
25
- nodeModulesPath = parts.slice(0, nodeModulesIndex).join(node_path.sep);
38
+ const parentDir = nodeModulesIndex !== -1 ? parts.slice(0, nodeModulesIndex).join(node_path.sep) : dirname;
39
+ const parentDirPath = node_path.join(parentDir, typescriptPackageJsonPath);
40
+ if (cwdPath === parentDirPath) {
41
+ return [cwdPath];
26
42
  }
27
- else {
28
- nodeModulesPath = dirname;
29
- }
30
- return node_path.join(nodeModulesPath, "node_modules", "typescript", "package.json");
43
+ return [parentDirPath, cwdPath];
31
44
  };
32
45
 
33
46
  let tscVersion;
@@ -38,19 +51,23 @@ const getTypeScriptUserAgentPair = async () => {
38
51
  else if (typeof tscVersion === "string") {
39
52
  return ["md/tsc", tscVersion];
40
53
  }
41
- try {
42
- const packageJson = await promises.readFile(getTypeScriptPackageJsonPath(__dirname), "utf-8");
43
- const { version } = JSON.parse(packageJson);
44
- if (typeof version !== "string") {
45
- tscVersion = null;
46
- return undefined;
54
+ const dirname = typeof __dirname !== "undefined" ? __dirname : undefined;
55
+ for (const typescriptPackageJsonPath of getTypeScriptPackageJsonPaths(dirname)) {
56
+ try {
57
+ const packageJson = await promises.readFile(typescriptPackageJsonPath, "utf-8");
58
+ const { version } = JSON.parse(packageJson);
59
+ const sanitizedVersion = getSanitizedTypeScriptVersion(version);
60
+ if (typeof sanitizedVersion !== "string") {
61
+ continue;
62
+ }
63
+ tscVersion = sanitizedVersion;
64
+ return ["md/tsc", tscVersion];
65
+ }
66
+ catch {
47
67
  }
48
- tscVersion = version;
49
- return ["md/tsc", tscVersion];
50
- }
51
- catch {
52
- tscVersion = null;
53
68
  }
69
+ tscVersion = null;
70
+ return undefined;
54
71
  };
55
72
 
56
73
  const crtAvailability = {
@@ -0,0 +1,9 @@
1
+ const SEMVER_REGEX = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*)?$/;
2
+ export const getSanitizedTypeScriptVersion = (version = "") => {
3
+ const match = version.match(SEMVER_REGEX);
4
+ if (!match) {
5
+ return undefined;
6
+ }
7
+ const [major, minor, patch, prerelease] = [match[1], match[2], match[3], match[4]];
8
+ return prerelease ? `${major}.${minor}.${patch}-${prerelease}` : `${major}.${minor}.${patch}`;
9
+ };
@@ -0,0 +1,17 @@
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,5 +1,6 @@
1
1
  import { readFile } from "node:fs/promises";
2
- import { getTypeScriptPackageJsonPath } from "./getTypeScriptPackageJsonPath";
2
+ import { getSanitizedTypeScriptVersion } from "./getSanitizedTypeScriptVersion";
3
+ import { getTypeScriptPackageJsonPaths } from "./getTypeScriptPackageJsonPaths";
3
4
  let tscVersion;
4
5
  export const getTypeScriptUserAgentPair = async () => {
5
6
  if (tscVersion === null) {
@@ -8,17 +9,21 @@ export const getTypeScriptUserAgentPair = async () => {
8
9
  else if (typeof tscVersion === "string") {
9
10
  return ["md/tsc", tscVersion];
10
11
  }
11
- try {
12
- const packageJson = await readFile(getTypeScriptPackageJsonPath(__dirname), "utf-8");
13
- const { version } = JSON.parse(packageJson);
14
- if (typeof version !== "string") {
15
- tscVersion = null;
16
- return undefined;
12
+ const dirname = typeof __dirname !== "undefined" ? __dirname : undefined;
13
+ for (const typescriptPackageJsonPath of getTypeScriptPackageJsonPaths(dirname)) {
14
+ try {
15
+ const packageJson = await readFile(typescriptPackageJsonPath, "utf-8");
16
+ const { version } = JSON.parse(packageJson);
17
+ const sanitizedVersion = getSanitizedTypeScriptVersion(version);
18
+ if (typeof sanitizedVersion !== "string") {
19
+ continue;
20
+ }
21
+ tscVersion = sanitizedVersion;
22
+ return ["md/tsc", tscVersion];
23
+ }
24
+ catch {
17
25
  }
18
- tscVersion = version;
19
- return ["md/tsc", tscVersion];
20
- }
21
- catch {
22
- tscVersion = null;
23
26
  }
27
+ tscVersion = null;
28
+ return undefined;
24
29
  };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Validates a semver string (with optional pre-release and/or build metadata).
3
+ * If valid, returns the version string with build metadata stripped.
4
+ * Returns undefined if the string is not a valid semver.
5
+ *
6
+ * @internal
7
+ */
8
+ export declare const getSanitizedTypeScriptVersion: (version?: string) => string | undefined;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Returns candidate paths to the TypeScript package.json file derived from the current
3
+ * working directory and, if provided, from the given directory.
4
+ *
5
+ * @param dirname - Optional directory path to derive an additional candidate path from.
6
+ * @returns An array of unique candidate paths to the TypeScript package.json file.
7
+ *
8
+ * @internal
9
+ */
10
+ export declare const getTypeScriptPackageJsonPaths: (dirname?: string) => string[];
@@ -0,0 +1,3 @@
1
+ export declare const getSanitizedTypeScriptVersion: (
2
+ version?: string
3
+ ) => string | undefined;
@@ -0,0 +1,3 @@
1
+ export declare const getTypeScriptPackageJsonPaths: (
2
+ dirname?: string
3
+ ) => string[];
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/util-user-agent-node",
3
- "version": "3.973.0",
3
+ "version": "3.973.1",
4
4
  "scripts": {
5
5
  "build": "concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs",
6
6
  "build:cjs": "node ../../scripts/compilation/inline util-user-agent-node",
@@ -24,7 +24,7 @@
24
24
  },
25
25
  "license": "Apache-2.0",
26
26
  "dependencies": {
27
- "@aws-sdk/middleware-user-agent": "^3.972.15",
27
+ "@aws-sdk/middleware-user-agent": "^3.972.16",
28
28
  "@aws-sdk/types": "^3.973.4",
29
29
  "@smithy/node-config-provider": "^4.3.10",
30
30
  "@smithy/types": "^4.13.0",
@@ -10,6 +10,7 @@ const parser = new fast_xml_parser_1.XMLParser({
10
10
  parseTagValue: false,
11
11
  trimValues: false,
12
12
  tagValueProcessor: (_, val) => (val.trim() === "" && val.includes("\n") ? "" : undefined),
13
+ maxNestedTags: 1024,
13
14
  });
14
15
  parser.addEntity("#xD", "\r");
15
16
  parser.addEntity("#10", "\n");
@@ -7,6 +7,7 @@ const parser = new XMLParser({
7
7
  parseTagValue: false,
8
8
  trimValues: false,
9
9
  tagValueProcessor: (_, val) => (val.trim() === "" && val.includes("\n") ? "" : undefined),
10
+ maxNestedTags: 1024,
10
11
  });
11
12
  parser.addEntity("#xD", "\r");
12
13
  parser.addEntity("#10", "\n");
@@ -1,5 +1,28 @@
1
1
  <small>Note: If you find missing information about particular minor version, that version must have been changed without any functional change in this library.</small>
2
2
 
3
+ **5.4.1 / 2026-02-25**
4
+ - fix (#785) unpairedTag node should not have tag content
5
+
6
+
7
+ **5.4.0 / 2026-02-25**
8
+ - migrate to fast-xml-builder
9
+
10
+ 5.3.9
11
+ **5.3.9 / 2026-02-25**
12
+ - support strictReservedNames
13
+
14
+ 5.3.8
15
+ **5.3.8 / 2026-02-25**
16
+ - support maxNestedTags
17
+ - handle non-array input for XML builder when preserveOrder is true (By [Angelo Coetzee](https://github.com/Angelopvtac))
18
+ - save use of js properies
19
+
20
+ 5.3.7
21
+ **5.3.7 / 2026-02-20**
22
+ - fix typings for CJS (By [Corentin Girard](https://github.com/Drarig29))
23
+
24
+
25
+
3
26
  **5.3.6 / 2026-02-14**
4
27
  - Improve security and performance of entity processing
5
28
  - new options `maxEntitySize`, `maxExpansionDepth`, `maxTotalExpansions`, `maxExpandedLength`, `allowedTags`,`tagFilter`
@@ -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.XMLBuilder=e():t.XMLBuilder=e()}(this,(()=>(()=>{"use strict";var t={d:(e,i)=>{for(var r in i)t.o(i,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:i[r]})},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){var i="";return e.format&&e.indentBy.length>0&&(i="\n"),r(t,e,"",i)}function r(t,e,i,u){for(var p="",h=!1,l=0;l<t.length;l++){var d=t[l],f=n(d);if(void 0!==f){var c;if(c=0===i.length?f:i+"."+f,f!==e.textNodeName)if(f!==e.cdataPropName)if(f!==e.commentPropName)if("?"!==f[0]){var g=u;""!==g&&(g+=e.indentBy);var b=u+"<"+f+o(d[":@"],e),m=r(d[f],e,c,g);-1!==e.unpairedTags.indexOf(f)?e.suppressUnpairedNode?p+=b+">":p+=b+"/>":m&&0!==m.length||!e.suppressEmptyNode?m&&m.endsWith(">")?p+=b+">"+m+u+"</"+f+">":(p+=b+">",m&&""!==u&&(m.includes("/>")||m.includes("</"))?p+=u+e.indentBy+m+u:p+=m,p+="</"+f+">"):p+=b+"/>",h=!0}else{var N=o(d[":@"],e),v="?xml"===f?"":u,y=d[f][0][e.textNodeName];p+=v+"<"+f+(y=0!==y.length?" "+y:"")+N+"?>",h=!0}else p+=u+"\x3c!--"+d[f][0][e.textNodeName]+"--\x3e",h=!0;else h&&(p+=u),p+="<![CDATA["+d[f][0][e.textNodeName]+"]]>",h=!1;else{var x=d[f];s(c,e)||(x=a(x=e.tagValueProcessor(f,x),e)),h&&(p+=u),p+=x,h=!1}}}return p}function n(t){for(var e=Object.keys(t),i=0;i<e.length;i++){var r=e[i];if(t.hasOwnProperty(r)&&":@"!==r)return r}}function o(t,e){var i="";if(t&&!e.ignoreAttributes)for(var r in t)if(t.hasOwnProperty(r)){var n=e.attributeValueProcessor(r,t[r]);!0===(n=a(n,e))&&e.suppressBooleanAttributes?i+=" "+r.substr(e.attributeNamePrefix.length):i+=" "+r.substr(e.attributeNamePrefix.length)+'="'+n+'"'}return i}function s(t,e){var i=(t=t.substr(0,t.length-e.textNodeName.length-1)).substr(t.lastIndexOf(".")+1);for(var r in e.stopNodes)if(e.stopNodes[r]===t||e.stopNodes[r]==="*."+i)return!0;return!1}function a(t,e){if(t&&t.length>0&&e.processEntities)for(var i=0;i<e.entities.length;i++){var r=e.entities[i];t=t.replace(r.regex,r.val)}return t}function u(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,r=Array(e);i<e;i++)r[i]=t[i];return r}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:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],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 i,r=function(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(i)return(i=i.call(t)).next.bind(i);if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return u(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?u(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}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);!(i=r()).done;){var n=i.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,i,r){var n=this.j2x(t,i+1,r.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 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?i(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,i){var r="",n="",o=i.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))r+=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,i.concat(s));h+=c.val,this.options.attributesGroupName&&f.hasOwnProperty(this.options.attributesGroupName)&&(l+=c.attrStr)}else h+=this.processTextOrObjNode(f,s,e,i);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,N=0;N<m;N++)r+=this.buildAttrPairStr(b[N],""+t[s][b[N]]);else n+=this.processTextOrObjNode(t[s],s,e,i);return{attrStr:r,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,i,r){if(""===t)return"?"===e[0]?this.indentate(r)+"<"+e+i+"?"+this.tagEndChar:this.indentate(r)+"<"+e+i+this.closeTag(e)+this.tagEndChar;var 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(r)+"\x3c!--"+t+"--\x3e"+this.newLine:this.indentate(r)+"<"+e+i+o+this.tagEndChar+t+this.indentate(r)+n:this.indentate(r)+"<"+e+i+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,i,r){if(!1!==this.options.cdataPropName&&e===this.options.cdataPropName)return this.indentate(r)+"<![CDATA["+t+"]]>"+this.newLine;if(!1!==this.options.commentPropName&&e===this.options.commentPropName)return this.indentate(r)+"\x3c!--"+t+"--\x3e"+this.newLine;if("?"===e[0])return this.indentate(r)+"<"+e+i+"?"+this.tagEndChar;var n=this.options.tagValueProcessor(e,t);return""===(n=this.replaceEntitiesValue(n))?this.indentate(r)+"<"+e+i+this.closeTag(e)+this.tagEndChar:this.indentate(r)+"<"+e+i+">"+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 i=this.options.entities[e];t=t.replace(i.regex,i.val)}return t},e})()));
1
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.XMLBuilder=e():t.XMLBuilder=e()}(this,()=>(()=>{"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 b=p+`<${c}${o(d[":@"],e)}`,N=s(d[c],e,f,g);-1!==e.unpairedTags.indexOf(c)?e.suppressUnpairedNode?u+=b+">":u+=b+"/>":N&&0!==N.length||!e.suppressEmptyNode?N&&N.endsWith(">")?u+=b+`>${N}${p}</${c}>`:(u+=b+">",N&&""!==p&&(N.includes("/>")||N.includes("</"))?u+=p+e.indentBy+N+p:u+=N,u+=`</${c}>`):u+=b+"/>",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:()=>c});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:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],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};const c=u;return e})());
2
2
  //# sourceMappingURL=fxbuilder.min.js.map