(node, startIndex)
| 20 | this.child.push({ [key]: val }); |
| 21 | } |
| 22 | addChild(node, startIndex) { |
| 23 | if (node.tagname === "__proto__") node.tagname = "#__proto__"; |
| 24 | if (node[":@"] && Object.keys(node[":@"]).length > 0) { |
| 25 | this.child.push({ [node.tagname]: node.child, [":@"]: node[":@"] }); |
| 26 | } else { |
| 27 | this.child.push({ [node.tagname]: node.child }); |
| 28 | } |
| 29 | // if requested, add the startIndex |
| 30 | this.addStartIndex(startIndex); |
| 31 | } |
| 32 | |
| 33 | addStartIndex(startIndex) { |
| 34 | if (startIndex !== undefined) { |
no test coverage detected