UNPKG

@prescott/geo-pattern

Version:

Create beautiful generative geometric background images from a string.

20 lines 717 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.SVGNode = void 0; class SVGNode { constructor(nodeName, attributes, childNode = []) { this.nodeName = nodeName; this.attributes = attributes; this.childNode = childNode; } appendChild(...elements) { this.childNode.push(...elements); } toXML() { const attrs = Object.keys(this.attributes).map((name) => ` ${name}="${this.attributes[name]}"`).join(""); const inner = this.childNode.map((children) => children.toXML()).join(""); return `<${this.nodeName}${attrs}>${inner}</${this.nodeName}>`; } } exports.SVGNode = SVGNode; //# sourceMappingURL=svg.js.map