4 hasProp = {}.hasOwnProperty;
6 module.exports = XMLWriterBase = (
function() {
7 function XMLWriterBase(options) {
8 var key, ref, ref1, ref2, ref3, ref4, value;
9 options || (options = {});
10 this.pretty = options.pretty ||
false;
11 this.allowEmpty = (ref = options.allowEmpty) != null ? ref :
false;
13 this.indent = (ref1 = options.indent) != null ? ref1 :
' ';
14 this.newline = (ref2 = options.newline) != null ? ref2 :
'\n';
15 this.offset = (ref3 = options.offset) != null ? ref3 : 0;
21 ref4 = options.writer || {};
23 if (!hasProp.call(ref4, key))
continue;
29 XMLWriterBase.prototype.set =
function(options) {
31 options || (options = {});
32 if (
"pretty" in options) {
33 this.pretty = options.pretty;
35 if (
"allowEmpty" in options) {
36 this.allowEmpty = options.allowEmpty;
39 this.indent =
"indent" in options ? options.indent :
' ';
40 this.newline =
"newline" in options ? options.newline :
'\n';
41 this.offset =
"offset" in options ? options.offset : 0;
47 ref = options.writer || {};
49 if (!hasProp.call(ref, key))
continue;
56 XMLWriterBase.prototype.space =
function(level) {
58 return new Array((level || 0) + this.offset + 1).join(this.indent);