aboutsummaryrefslogtreecommitdiff
path: root/generator/node_modules/xmlbuilder/lib/XMLAttribute.js
diff options
context:
space:
mode:
authorRaindropsSys <raindrops@equestria.dev>2024-05-12 17:18:54 +0200
committerRaindropsSys <raindrops@equestria.dev>2024-05-12 17:18:54 +0200
commitfcdb5ca193406ef02dba8db4d7684d8c74089552 (patch)
tree223edcc76b54d18575d2c3bcd87ed321f8a896d6 /generator/node_modules/xmlbuilder/lib/XMLAttribute.js
parentd9337f848b94f33aa8641acced33c6c2e5efc26e (diff)
downloadatomic-fcdb5ca193406ef02dba8db4d7684d8c74089552.tar.gz
atomic-fcdb5ca193406ef02dba8db4d7684d8c74089552.tar.bz2
atomic-fcdb5ca193406ef02dba8db4d7684d8c74089552.zip
Updated 9 files and added 103 files (automated)
Diffstat (limited to 'generator/node_modules/xmlbuilder/lib/XMLAttribute.js')
-rw-r--r--generator/node_modules/xmlbuilder/lib/XMLAttribute.js130
1 files changed, 130 insertions, 0 deletions
diff --git a/generator/node_modules/xmlbuilder/lib/XMLAttribute.js b/generator/node_modules/xmlbuilder/lib/XMLAttribute.js
new file mode 100644
index 0000000..71922b7
--- /dev/null
+++ b/generator/node_modules/xmlbuilder/lib/XMLAttribute.js
@@ -0,0 +1,130 @@
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var NodeType, XMLAttribute, XMLNode;
+
+ NodeType = require('./NodeType');
+
+ XMLNode = require('./XMLNode');
+
+ // Represents an attribute
+ module.exports = XMLAttribute = (function() {
+ class XMLAttribute {
+ // Initializes a new instance of `XMLAttribute`
+
+ // `parent` the parent node
+ // `name` attribute target
+ // `value` attribute value
+ constructor(parent, name, value) {
+ this.parent = parent;
+ if (this.parent) {
+ this.options = this.parent.options;
+ this.stringify = this.parent.stringify;
+ }
+ if (name == null) {
+ throw new Error("Missing attribute name. " + this.debugInfo(name));
+ }
+ this.name = this.stringify.name(name);
+ this.value = this.stringify.attValue(value);
+ this.type = NodeType.Attribute;
+ // DOM level 3
+ this.isId = false;
+ this.schemaTypeInfo = null;
+ }
+
+ // Creates and returns a deep clone of `this`
+ clone() {
+ return Object.create(this);
+ }
+
+ // Converts the XML fragment to string
+
+ // `options.pretty` pretty prints the result
+ // `options.indent` indentation for pretty print
+ // `options.offset` how many indentations to add to every line for pretty print
+ // `options.newline` newline sequence for pretty print
+ toString(options) {
+ return this.options.writer.attribute(this, this.options.writer.filterOptions(options));
+ }
+
+
+ // Returns debug string for this node
+ debugInfo(name) {
+ name = name || this.name;
+ if (name == null) {
+ return "parent: <" + this.parent.name + ">";
+ } else {
+ return "attribute: {" + name + "}, parent: <" + this.parent.name + ">";
+ }
+ }
+
+ isEqualNode(node) {
+ if (node.namespaceURI !== this.namespaceURI) {
+ return false;
+ }
+ if (node.prefix !== this.prefix) {
+ return false;
+ }
+ if (node.localName !== this.localName) {
+ return false;
+ }
+ if (node.value !== this.value) {
+ return false;
+ }
+ return true;
+ }
+
+ };
+
+ // DOM level 1
+ Object.defineProperty(XMLAttribute.prototype, 'nodeType', {
+ get: function() {
+ return this.type;
+ }
+ });
+
+ Object.defineProperty(XMLAttribute.prototype, 'ownerElement', {
+ get: function() {
+ return this.parent;
+ }
+ });
+
+ // DOM level 3
+ Object.defineProperty(XMLAttribute.prototype, 'textContent', {
+ get: function() {
+ return this.value;
+ },
+ set: function(value) {
+ return this.value = value || '';
+ }
+ });
+
+ // DOM level 4
+ Object.defineProperty(XMLAttribute.prototype, 'namespaceURI', {
+ get: function() {
+ return '';
+ }
+ });
+
+ Object.defineProperty(XMLAttribute.prototype, 'prefix', {
+ get: function() {
+ return '';
+ }
+ });
+
+ Object.defineProperty(XMLAttribute.prototype, 'localName', {
+ get: function() {
+ return this.name;
+ }
+ });
+
+ Object.defineProperty(XMLAttribute.prototype, 'specified', {
+ get: function() {
+ return true;
+ }
+ });
+
+ return XMLAttribute;
+
+ }).call(this);
+
+}).call(this);