MCPcopy Create free account
hub / github.com/NaturalIntelligence/fast-xml-parser / add

Method add

src/xmlparser/xmlNode.js:17–21  ·  view source on GitHub ↗
(key, val)

Source from the content-addressed store, hash-verified

15 this[":@"] = Object.create(null); //attributes map
16 }
17 add(key, val) {
18 // this.child.push( {name : key, val: val, isCdata: isCdata });
19 if (key === "__proto__") key = "#__proto__";
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) {

Callers 6

yaFunction · 0.45
HaFunction · 0.45
constructorMethod · 0.45
parseXmlFunction · 0.45
saveTextToParentTagFunction · 0.45

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected