Comparing version 1.10.0 to 1.10.1
@@ -12,3 +12,9 @@ const findTagsByName = require("./find-tags-by-name.js"); | ||
let tags = findTagsByName(xml, path0.name, { debug, nested: false }); | ||
if (typeof path0.index === "number") tags = [tags[path0.index]]; | ||
if (typeof tags !== "undefined" && typeof path0.index === "number") { | ||
if (typeof tags[path0.index] === "undefined") { | ||
tags = []; | ||
} else { | ||
tags = [tags[path0.index]]; | ||
} | ||
} | ||
if (debug) console.log("first tags are:", tags); | ||
@@ -39,3 +45,9 @@ | ||
tags = allSubTags; | ||
if (typeof part.index === "number") tags = [tags[part.index]]; | ||
if (typeof part.index === "number") { | ||
if (typeof tags[part.index] === "undefined") { | ||
tags = []; | ||
} else { | ||
tags = [tags[part.index]]; | ||
} | ||
} | ||
} | ||
@@ -42,0 +54,0 @@ return tags; |
{ | ||
"name": "xml-utils", | ||
"version": "1.10.0", | ||
"version": "1.10.1", | ||
"description": "Parse XML without Blowing Up Your Bundle Size", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
29943
397
269279