@cdk8s/awscdk-resolver 0.0.543 → 0.0.545
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.jsii +3 -3
- package/lib/resolve.js +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/package.json +14 -14
- package/node_modules/@aws-sdk/core/package.json +5 -5
- package/node_modules/@aws-sdk/credential-provider-env/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-http/package.json +5 -5
- package/node_modules/@aws-sdk/credential-provider-ini/package.json +9 -9
- package/node_modules/@aws-sdk/credential-provider-login/package.json +3 -3
- package/node_modules/@aws-sdk/credential-provider-node/package.json +7 -7
- package/node_modules/@aws-sdk/credential-provider-process/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-sso/package.json +4 -4
- package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +3 -3
- package/node_modules/@aws-sdk/middleware-sdk-s3/package.json +5 -5
- package/node_modules/@aws-sdk/middleware-user-agent/package.json +4 -4
- package/node_modules/@aws-sdk/nested-clients/package.json +14 -14
- package/node_modules/@aws-sdk/signature-v4-multi-region/package.json +2 -2
- package/node_modules/@aws-sdk/token-providers/package.json +3 -3
- package/node_modules/@aws-sdk/util-user-agent-node/package.json +2 -2
- package/node_modules/@aws-sdk/xml-builder/dist-cjs/xml-parser.js +0 -2
- package/node_modules/@aws-sdk/xml-builder/dist-es/xml-parser.js +0 -2
- package/node_modules/@aws-sdk/xml-builder/package.json +2 -2
- package/node_modules/@nodable/entities/README.md +41 -0
- package/node_modules/@nodable/entities/package.json +54 -0
- package/node_modules/@nodable/entities/src/EntityDecoder.js +543 -0
- package/node_modules/@nodable/entities/src/EntityEncoder.js +194 -0
- package/node_modules/@nodable/entities/src/entities.js +1177 -0
- package/node_modules/@nodable/entities/src/entityTries.js +49 -0
- package/node_modules/@nodable/entities/src/index.d.ts +264 -0
- package/node_modules/@nodable/entities/src/index.js +29 -0
- package/node_modules/@smithy/core/package.json +2 -2
- package/node_modules/@smithy/middleware-endpoint/package.json +3 -3
- package/node_modules/@smithy/middleware-retry/package.json +4 -4
- package/node_modules/@smithy/middleware-serde/package.json +2 -2
- package/node_modules/@smithy/node-http-handler/dist-cjs/index.js +27 -16
- package/node_modules/@smithy/node-http-handler/dist-es/http2/ClientHttp2SessionRef.js +5 -0
- package/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-manager.js +22 -16
- package/node_modules/@smithy/node-http-handler/dist-types/http2/ClientHttp2SessionRef.d.ts +4 -0
- package/node_modules/@smithy/node-http-handler/dist-types/node-http2-connection-manager.d.ts +2 -4
- package/node_modules/@smithy/node-http-handler/package.json +1 -1
- package/node_modules/@smithy/smithy-client/package.json +4 -4
- package/node_modules/@smithy/util-defaults-mode-browser/package.json +2 -2
- package/node_modules/@smithy/util-defaults-mode-node/package.json +2 -2
- package/node_modules/@smithy/util-retry/dist-cjs/index.js +20 -10
- package/node_modules/@smithy/util-retry/dist-es/StandardRetryStrategy.js +20 -10
- package/node_modules/@smithy/util-retry/dist-types/StandardRetryStrategy.d.ts +12 -4
- package/node_modules/@smithy/util-retry/package.json +1 -1
- package/node_modules/@smithy/util-stream/package.json +2 -2
- package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/CHANGELOG.md +53 -0
- package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/README.md +8 -28
- package/node_modules/fast-xml-parser/lib/fxbuilder.min.js +2 -0
- package/node_modules/fast-xml-parser/lib/fxbuilder.min.js.map +1 -0
- package/node_modules/fast-xml-parser/lib/fxp.cjs +1 -0
- package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/lib/fxp.d.cts +172 -6
- package/node_modules/fast-xml-parser/lib/fxp.min.js +2 -0
- package/node_modules/fast-xml-parser/lib/fxp.min.js.map +1 -0
- package/node_modules/fast-xml-parser/lib/fxparser.min.js +2 -0
- package/node_modules/fast-xml-parser/lib/fxparser.min.js.map +1 -0
- package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/package.json +5 -4
- package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/fxp.d.ts +162 -3
- package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/xmlparser/DocTypeReader.js +2 -5
- package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/xmlparser/OptionsBuilder.js +15 -11
- package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/xmlparser/OrderedObjParser.js +168 -244
- package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/xmlparser/XMLParser.js +1 -1
- package/package.json +6 -6
- package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxbuilder.min.js +0 -2
- package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxbuilder.min.js.map +0 -1
- package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxp.cjs +0 -1
- package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxp.min.js +0 -2
- package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxp.min.js.map +0 -1
- package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxparser.min.js +0 -2
- package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxparser.min.js.map +0 -1
- package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/pem.d.cts +0 -148
- package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/pem.d.ts +0 -135
- /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/LICENSE +0 -0
- /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/lib/fxvalidator.min.js +0 -0
- /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/lib/fxvalidator.min.js.map +0 -0
- /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/cli/cli.js +0 -0
- /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/cli/man.js +0 -0
- /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/cli/read.js +0 -0
- /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/fxp.js +0 -0
- /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/ignoreAttributes.js +0 -0
- /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/util.js +0 -0
- /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/v6/CharsSymbol.js +0 -0
- /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/v6/EntitiesParser.js +0 -0
- /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/v6/OptionsBuilder.js +0 -0
- /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/v6/OutputBuilders/BaseOutputBuilder.js +0 -0
- /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/v6/OutputBuilders/JsArrBuilder.js +0 -0
- /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/v6/OutputBuilders/JsMinArrBuilder.js +0 -0
- /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/v6/OutputBuilders/JsObjBuilder.js +0 -0
- /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/v6/OutputBuilders/ParserOptionsBuilder.js +0 -0
- /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/v6/Report.js +0 -0
- /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/v6/TagPath.js +0 -0
- /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/v6/TagPathMatcher.js +0 -0
- /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/v6/XMLParser.js +0 -0
- /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/v6/Xml2JsParser.js +0 -0
- /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/v6/XmlPartReader.js +0 -0
- /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/v6/XmlSpecialTagsReader.js +0 -0
- /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/v6/inputSource/BufferSource.js +0 -0
- /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/v6/inputSource/StringSource.js +0 -0
- /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/v6/valueParsers/EntitiesParser.js +0 -0
- /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/v6/valueParsers/booleanParser.js +0 -0
- /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/v6/valueParsers/booleanParserExt.js +0 -0
- /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/v6/valueParsers/currency.js +0 -0
- /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/v6/valueParsers/join.js +0 -0
- /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/v6/valueParsers/number.js +0 -0
- /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/v6/valueParsers/trim.js +0 -0
- /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/validator.js +0 -0
- /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/xmlbuilder/json2xml.js +0 -0
- /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/xmlparser/node2json.js +0 -0
- /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/xmlparser/xmlNode.js +0 -0
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
// EntityDecoder.js
|
|
2
|
+
import { trie1, trie2, trie3 } from './entityTries.js';
|
|
3
|
+
|
|
4
|
+
// Replacement strings indexed by char code — direct array access, no hashing
|
|
5
|
+
const XML_UNSAFE_REPLACEMENT = new Array(128);
|
|
6
|
+
XML_UNSAFE_REPLACEMENT[38] = '&'; // &
|
|
7
|
+
XML_UNSAFE_REPLACEMENT[60] = '<'; // <
|
|
8
|
+
XML_UNSAFE_REPLACEMENT[62] = '>'; // >
|
|
9
|
+
XML_UNSAFE_REPLACEMENT[34] = '"'; // "
|
|
10
|
+
XML_UNSAFE_REPLACEMENT[39] = '''; // '
|
|
11
|
+
|
|
12
|
+
// Typed bitmask for O(1) "is this ASCII code XML-unsafe?" check
|
|
13
|
+
const IS_XML_UNSAFE = new Uint8Array(128);
|
|
14
|
+
IS_XML_UNSAFE[38] = 1;
|
|
15
|
+
IS_XML_UNSAFE[60] = 1;
|
|
16
|
+
IS_XML_UNSAFE[62] = 1;
|
|
17
|
+
IS_XML_UNSAFE[34] = 1;
|
|
18
|
+
IS_XML_UNSAFE[39] = 1;
|
|
19
|
+
|
|
20
|
+
// Fast pre-scan: bail out immediately if nothing needs encoding
|
|
21
|
+
const NEEDS_PROCESSING = /[&<>"'\u0080-\uFFFF]/;
|
|
22
|
+
|
|
23
|
+
export default class EntityEncoder {
|
|
24
|
+
constructor(options = {}) {
|
|
25
|
+
this.encodeXmlSafe = options.encodeXmlSafe !== false;
|
|
26
|
+
this.encodeAllNamed = options.encodeAllNamed !== false;
|
|
27
|
+
this.maxReplacements = options.maxReplacements || 0;
|
|
28
|
+
this.replacementsCount = 0;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
encode(str) {
|
|
32
|
+
if (typeof str !== 'string' || str.length === 0) return str;
|
|
33
|
+
if (!NEEDS_PROCESSING.test(str)) return str;
|
|
34
|
+
|
|
35
|
+
const maxRep = this.maxReplacements;
|
|
36
|
+
if (maxRep > 0 && this.replacementsCount >= maxRep) return str;
|
|
37
|
+
|
|
38
|
+
// Hoist to locals — avoids `this` property lookup inside the hot loop
|
|
39
|
+
const encodeXmlSafe = this.encodeXmlSafe;
|
|
40
|
+
const encodeAllNamed = this.encodeAllNamed;
|
|
41
|
+
|
|
42
|
+
const len = str.length;
|
|
43
|
+
|
|
44
|
+
let result = '';
|
|
45
|
+
let last = 0;
|
|
46
|
+
let i = 0;
|
|
47
|
+
let limitReached = false;
|
|
48
|
+
|
|
49
|
+
// ── Main loop: runs to len-2 so trie3 never needs a bounds check ────────
|
|
50
|
+
// The last 2 characters are handled by the tail block below.
|
|
51
|
+
const mainEnd = len - 2; // i <= mainEnd guarantees i+1 and i+2 are valid
|
|
52
|
+
|
|
53
|
+
while (i <= mainEnd && !limitReached) {
|
|
54
|
+
const c0 = str.charCodeAt(i);
|
|
55
|
+
|
|
56
|
+
// ── ASCII branch ───────────────────────────────────────────────────
|
|
57
|
+
if (c0 < 128) {
|
|
58
|
+
if (encodeXmlSafe && IS_XML_UNSAFE[c0] === 1) {
|
|
59
|
+
result += str.substring(last, i) + XML_UNSAFE_REPLACEMENT[c0];
|
|
60
|
+
last = ++i;
|
|
61
|
+
if (maxRep > 0) {
|
|
62
|
+
this.replacementsCount++;
|
|
63
|
+
if (this.replacementsCount >= maxRep) {
|
|
64
|
+
limitReached = true;
|
|
65
|
+
break;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
} else {
|
|
69
|
+
// Bulk-skip: advance to the next interesting position without
|
|
70
|
+
// touching the outer loop overhead on every safe character
|
|
71
|
+
i++;
|
|
72
|
+
while (i <= mainEnd && !limitReached) {
|
|
73
|
+
const c = str.charCodeAt(i);
|
|
74
|
+
if (c >= 128 || (encodeXmlSafe && IS_XML_UNSAFE[c] === 1)) break;
|
|
75
|
+
i++;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
continue;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// ── Non-ASCII: integer-keyed trie lookup ───────────────────────────
|
|
82
|
+
// No bounds checks needed for c1/c2 because i <= mainEnd guarantees
|
|
83
|
+
// i+1 and i+2 are both within the string.
|
|
84
|
+
let matchedEntity = null;
|
|
85
|
+
let advance = 1;
|
|
86
|
+
|
|
87
|
+
// Try 3-char match first (longest wins)
|
|
88
|
+
const mid3 = trie3.get(c0);
|
|
89
|
+
if (mid3 !== undefined) {
|
|
90
|
+
const c1 = str.charCodeAt(i + 1);
|
|
91
|
+
const inner3 = mid3.get(c1);
|
|
92
|
+
if (inner3 !== undefined) {
|
|
93
|
+
const c2 = str.charCodeAt(i + 2);
|
|
94
|
+
const candidate = inner3.get(c2);
|
|
95
|
+
if (candidate !== undefined) { matchedEntity = candidate; advance = 3; }
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// Try 2-char match
|
|
100
|
+
if (matchedEntity === null) {
|
|
101
|
+
const inner2 = trie2.get(c0);
|
|
102
|
+
if (inner2 !== undefined) {
|
|
103
|
+
const c1 = str.charCodeAt(i + 1);
|
|
104
|
+
const candidate = inner2.get(c1);
|
|
105
|
+
if (candidate !== undefined) { matchedEntity = candidate; advance = 2; }
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// Try 1-char match
|
|
110
|
+
if (matchedEntity === null && encodeAllNamed) {
|
|
111
|
+
const candidate = trie1.get(c0);
|
|
112
|
+
if (candidate !== undefined) { matchedEntity = candidate; }
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
if (matchedEntity !== null) {
|
|
116
|
+
result += str.substring(last, i) + matchedEntity;
|
|
117
|
+
i += advance;
|
|
118
|
+
last = i;
|
|
119
|
+
if (maxRep > 0) {
|
|
120
|
+
this.replacementsCount++;
|
|
121
|
+
if (this.replacementsCount >= maxRep) {
|
|
122
|
+
limitReached = true;
|
|
123
|
+
break;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
} else {
|
|
127
|
+
i++;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
// ── Tail: handle the last 1-2 characters (no 3-char match possible) ────
|
|
132
|
+
while (i < len && !limitReached) {
|
|
133
|
+
const c0 = str.charCodeAt(i);
|
|
134
|
+
|
|
135
|
+
if (c0 < 128) {
|
|
136
|
+
if (encodeXmlSafe && IS_XML_UNSAFE[c0] === 1) {
|
|
137
|
+
result += str.substring(last, i) + XML_UNSAFE_REPLACEMENT[c0];
|
|
138
|
+
last = ++i;
|
|
139
|
+
if (maxRep > 0) {
|
|
140
|
+
this.replacementsCount++;
|
|
141
|
+
if (this.replacementsCount >= maxRep) {
|
|
142
|
+
limitReached = true;
|
|
143
|
+
break;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
} else {
|
|
147
|
+
i++;
|
|
148
|
+
}
|
|
149
|
+
continue;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// Non-ASCII tail — only 2-char and 1-char matches are possible here
|
|
153
|
+
let matchedEntity = null;
|
|
154
|
+
let advance = 1;
|
|
155
|
+
|
|
156
|
+
if (i + 1 < len) {
|
|
157
|
+
const inner2 = trie2.get(c0);
|
|
158
|
+
if (inner2 !== undefined) {
|
|
159
|
+
const c1 = str.charCodeAt(i + 1);
|
|
160
|
+
const candidate = inner2.get(c1);
|
|
161
|
+
if (candidate !== undefined) { matchedEntity = candidate; advance = 2; }
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
if (matchedEntity === null && encodeAllNamed) {
|
|
166
|
+
const candidate = trie1.get(c0);
|
|
167
|
+
if (candidate !== undefined) { matchedEntity = candidate; }
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
if (matchedEntity !== null) {
|
|
171
|
+
result += str.substring(last, i) + matchedEntity;
|
|
172
|
+
i += advance;
|
|
173
|
+
last = i;
|
|
174
|
+
if (maxRep > 0) {
|
|
175
|
+
this.replacementsCount++;
|
|
176
|
+
if (this.replacementsCount >= maxRep) {
|
|
177
|
+
limitReached = true;
|
|
178
|
+
break;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
} else {
|
|
182
|
+
i++;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
// ── Flush any remaining literal suffix ────────────────────────────────
|
|
187
|
+
if (last < len) result += str.substring(last);
|
|
188
|
+
return result;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
reset() {
|
|
192
|
+
this.replacementsCount = 0;
|
|
193
|
+
}
|
|
194
|
+
}
|