fast-xml-parser 4.1.1 → 4.1.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fast-xml-parser",
3
- "version": "4.1.1",
3
+ "version": "4.1.2",
4
4
  "description": "Validate XML, Parse XML, Build XML without C/C++ based libraries",
5
5
  "main": "./src/fxp.js",
6
6
  "scripts": {
@@ -137,6 +137,7 @@ function buildAttributesMap(attrStr, jPath) {
137
137
  if (this.options.transformAttributeName) {
138
138
  aName = this.options.transformAttributeName(aName);
139
139
  }
140
+ if(aName === "__proto__") aName = "#__proto__";
140
141
  if (oldVal !== undefined) {
141
142
  if (this.options.trimValues) {
142
143
  oldVal = oldVal.trim();
@@ -8,9 +8,11 @@ class XmlNode{
8
8
  }
9
9
  add(key,val){
10
10
  // this.child.push( {name : key, val: val, isCdata: isCdata });
11
+ if(key === "__proto__") key = "#__proto__";
11
12
  this.child.push( {[key]: val });
12
13
  }
13
14
  addChild(node) {
15
+ if(node.tagname === "__proto__") node.tagname = "#__proto__";
14
16
  if(node[":@"] && Object.keys(node[":@"]).length > 0){
15
17
  this.child.push( { [node.tagname]: node.child, [":@"]: node[":@"] });
16
18
  }else{