biofriction-wp-theme/node_modules/fast-xml-parser/src/xmlNode.js

18 lines
444 B
JavaScript
Raw Normal View History

2021-10-26 14:18:09 +02:00
'use strict';
module.exports = function(tagname, parent, val) {
this.tagname = tagname;
this.parent = parent;
this.child = {}; //child tags
this.attrsMap = {}; //attributes map
this.val = val; //text only
this.addChild = function(child) {
if (Array.isArray(this.child[child.tagname])) {
//already presents
this.child[child.tagname].push(child);
} else {
this.child[child.tagname] = [child];
}
};
};