Skip to content

Commit

Permalink
Update package detail
Browse files Browse the repository at this point in the history
  • Loading branch information
amitguptagwl committed Feb 12, 2023
1 parent 7a7dbac commit 2b032a4
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/fxp.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/fxp.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/fxparser.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/fxparser.min.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fast-xml-parser",
"version": "4.1.1",
"version": "4.1.2",
"description": "Validate XML, Parse XML, Build XML without C/C++ based libraries",
"main": "./src/fxp.js",
"scripts": {
Expand Down
1 change: 1 addition & 0 deletions src/xmlparser/OrderedObjParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ function buildAttributesMap(attrStr, jPath) {
if (this.options.transformAttributeName) {
aName = this.options.transformAttributeName(aName);
}
if(aName === "__proto__") aName = "#__proto__";
if (oldVal !== undefined) {
if (this.options.trimValues) {
oldVal = oldVal.trim();
Expand Down
2 changes: 2 additions & 0 deletions src/xmlparser/xmlNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ class XmlNode{
}
add(key,val){
// this.child.push( {name : key, val: val, isCdata: isCdata });
if(key === "__proto__") key = "#__proto__";
this.child.push( {[key]: val });
}
addChild(node) {
if(node.tagname === "__proto__") node.tagname = "#__proto__";
if(node[":@"] && Object.keys(node[":@"]).length > 0){
this.child.push( { [node.tagname]: node.child, [":@"]: node[":@"] });
}else{
Expand Down

0 comments on commit 2b032a4

Please sign in to comment.