diff options
author | Florian Dold <florian.dold@gmail.com> | 2016-11-03 01:33:53 +0100 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2016-11-03 01:33:53 +0100 |
commit | d1291f67551c58168af43698a359cb5ddfd266b0 (patch) | |
tree | 55a13ed29fe1915e3f42f1b1b7038dafa2e975a7 /node_modules/xmlbuilder/lib/XMLText.js | |
parent | d0a0695fb5d34996850723f7d4b1b59c3df909c2 (diff) |
node_modules
Diffstat (limited to 'node_modules/xmlbuilder/lib/XMLText.js')
-rw-r--r-- | node_modules/xmlbuilder/lib/XMLText.js | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/node_modules/xmlbuilder/lib/XMLText.js b/node_modules/xmlbuilder/lib/XMLText.js new file mode 100644 index 000000000..8241581ed --- /dev/null +++ b/node_modules/xmlbuilder/lib/XMLText.js @@ -0,0 +1,32 @@ +// Generated by CoffeeScript 1.10.0 +(function() { + var XMLNode, XMLText, + extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + hasProp = {}.hasOwnProperty; + + XMLNode = require('./XMLNode'); + + module.exports = XMLText = (function(superClass) { + extend(XMLText, superClass); + + function XMLText(parent, text) { + XMLText.__super__.constructor.call(this, parent); + if (text == null) { + throw new Error("Missing element text"); + } + this.value = this.stringify.eleText(text); + } + + XMLText.prototype.clone = function() { + return Object.create(this); + }; + + XMLText.prototype.toString = function(options) { + return this.options.writer.set(options).text(this); + }; + + return XMLText; + + })(XMLNode); + +}).call(this); |