Files
cordova-android/node_modules/xmlbuilder/lib/XMLAttribute.js
T

33 lines
904 B
JavaScript
Raw Normal View History

// Generated by CoffeeScript 1.9.1
2015-10-22 13:26:23 +03:00
(function() {
var XMLAttribute, create;
2015-10-22 13:26:23 +03:00
create = require('lodash/object/create');
2015-10-22 13:26:23 +03:00
module.exports = XMLAttribute = (function() {
function XMLAttribute(parent, name, value) {
this.stringify = parent.stringify;
if (name == null) {
throw new Error("Missing attribute name of element " + parent.name);
2015-10-22 13:26:23 +03:00
}
if (value == null) {
throw new Error("Missing attribute value for attribute " + name + " of element " + parent.name);
2015-10-22 13:26:23 +03:00
}
this.name = this.stringify.attName(name);
this.value = this.stringify.attValue(value);
}
XMLAttribute.prototype.clone = function() {
return create(XMLAttribute.prototype, this);
2015-10-22 13:26:23 +03:00
};
XMLAttribute.prototype.toString = function(options, level) {
return ' ' + this.name + '="' + this.value + '"';
};
return XMLAttribute;
})();
}).call(this);