ts-fusion-parser
Version:
Parser for Neos Fusion Files
23 lines (22 loc) • 872 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.TagAttributeNode = void 0;
const AbstractNode_1 = require("../../../common/AbstractNode");
class TagAttributeNode extends AbstractNode_1.AbstractNode {
constructor(position, name, value) {
super(position);
this.name = name;
this.value = value;
if (Array.isArray(this.value)) {
for (const element of this.value) {
if (element instanceof AbstractNode_1.AbstractNode)
AbstractNode_1.AbstractNode.setParentOfNode(element, this);
}
}
}
toString(intend) {
const valueString = Array.isArray(this.value) ? "{" + this.value.map(v => v.toString()).join(" ") + "}" : this.value;
return this.name + "=" + valueString;
}
}
exports.TagAttributeNode = TagAttributeNode;