fast-xml-parser 5.3.8 → 5.3.9
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/CHANGELOG.md +3 -0
- package/lib/fxp.cjs +1 -1
- package/lib/fxp.d.cts +7 -0
- package/lib/fxp.min.js +1 -1
- package/lib/fxp.min.js.map +1 -1
- package/lib/fxparser.min.js +1 -1
- package/lib/fxparser.min.js.map +1 -1
- package/package.json +1 -1
- package/src/fxp.d.ts +7 -0
- package/src/xmlparser/OptionsBuilder.js +1 -0
- package/src/xmlparser/OrderedObjParser.js +8 -0
package/src/fxp.d.ts
CHANGED
|
@@ -163,6 +163,7 @@ function buildAttributesMap(attrStr, jPath, tagName) {
|
|
|
163
163
|
aName = this.options.transformAttributeName(aName);
|
|
164
164
|
}
|
|
165
165
|
if (aName === "__proto__") aName = "#__proto__";
|
|
166
|
+
|
|
166
167
|
if (oldVal !== undefined) {
|
|
167
168
|
if (this.options.trimValues) {
|
|
168
169
|
oldVal = oldVal.trim();
|
|
@@ -322,6 +323,13 @@ const parseXml = function (xmlData) {
|
|
|
322
323
|
tagName = newTagName;
|
|
323
324
|
}
|
|
324
325
|
|
|
326
|
+
if (this.options.strictReservedNames &&
|
|
327
|
+
(tagName === this.options.commentPropName
|
|
328
|
+
|| tagName === this.options.cdataPropName
|
|
329
|
+
)) {
|
|
330
|
+
throw new Error(`Invalid tag name: ${tagName}`);
|
|
331
|
+
}
|
|
332
|
+
|
|
325
333
|
//save text as child node
|
|
326
334
|
if (currentNode && textData) {
|
|
327
335
|
if (currentNode.tagname !== '!xml') {
|