2016-11-16 01:59:39 +01:00
|
|
|
// Generated by CoffeeScript 1.9.1
|
2016-11-03 01:33:53 +01:00
|
|
|
(function() {
|
2016-11-16 01:59:39 +01:00
|
|
|
var XMLProcessingInstruction, create;
|
2016-11-03 01:33:53 +01:00
|
|
|
|
2016-11-16 01:59:39 +01:00
|
|
|
create = require('lodash/create');
|
2016-11-03 01:33:53 +01:00
|
|
|
|
2016-11-16 01:59:39 +01:00
|
|
|
module.exports = XMLProcessingInstruction = (function() {
|
2016-11-03 01:33:53 +01:00
|
|
|
function XMLProcessingInstruction(parent, target, value) {
|
2016-11-16 01:59:39 +01:00
|
|
|
this.stringify = parent.stringify;
|
2016-11-03 01:33:53 +01:00
|
|
|
if (target == null) {
|
|
|
|
throw new Error("Missing instruction target");
|
|
|
|
}
|
|
|
|
this.target = this.stringify.insTarget(target);
|
|
|
|
if (value) {
|
|
|
|
this.value = this.stringify.insValue(value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
XMLProcessingInstruction.prototype.clone = function() {
|
2016-11-16 01:59:39 +01:00
|
|
|
return create(XMLProcessingInstruction.prototype, this);
|
2016-11-03 01:33:53 +01:00
|
|
|
};
|
|
|
|
|
2016-11-16 01:59:39 +01:00
|
|
|
XMLProcessingInstruction.prototype.toString = function(options, level) {
|
|
|
|
var indent, newline, offset, pretty, r, ref, ref1, ref2, space;
|
|
|
|
pretty = (options != null ? options.pretty : void 0) || false;
|
|
|
|
indent = (ref = options != null ? options.indent : void 0) != null ? ref : ' ';
|
|
|
|
offset = (ref1 = options != null ? options.offset : void 0) != null ? ref1 : 0;
|
|
|
|
newline = (ref2 = options != null ? options.newline : void 0) != null ? ref2 : '\n';
|
|
|
|
level || (level = 0);
|
|
|
|
space = new Array(level + offset + 1).join(indent);
|
|
|
|
r = '';
|
|
|
|
if (pretty) {
|
|
|
|
r += space;
|
|
|
|
}
|
|
|
|
r += '<?';
|
|
|
|
r += this.target;
|
|
|
|
if (this.value) {
|
|
|
|
r += ' ' + this.value;
|
|
|
|
}
|
|
|
|
r += '?>';
|
|
|
|
if (pretty) {
|
|
|
|
r += newline;
|
|
|
|
}
|
|
|
|
return r;
|
2016-11-03 01:33:53 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
return XMLProcessingInstruction;
|
|
|
|
|
2016-11-16 01:59:39 +01:00
|
|
|
})();
|
2016-11-03 01:33:53 +01:00
|
|
|
|
|
|
|
}).call(this);
|