Skip to content

Commit

Permalink
Can't compare arrays directly in JS
Browse files Browse the repository at this point in the history
  • Loading branch information
mhart committed Sep 2, 2020
1 parent b3b33bf commit 124bfc9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changes/next-release/bugfix-XML-c6eb8219.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"type": "bugfix",
"category": "XML",
"description": "Fixed an array equality bug in the Node.js XML parser"
}
2 changes: 1 addition & 1 deletion lib/xml/node_parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ function parseUnknown(xml) {

// empty object
var keys = Object.keys(xml), i;
if (keys.length === 0 || keys === ['$']) {
if (keys.length === 0 || (keys.length === 1 && keys[0] === '$')) {
return {};
}

Expand Down

0 comments on commit 124bfc9

Please sign in to comment.