aboutsummaryrefslogtreecommitdiff
path: root/node_modules/xmlbuilder/lib/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/xmlbuilder/lib/index.js')
-rw-r--r--node_modules/xmlbuilder/lib/index.js49
1 files changed, 5 insertions, 44 deletions
diff --git a/node_modules/xmlbuilder/lib/index.js b/node_modules/xmlbuilder/lib/index.js
index de7ee8f32..be80d7cc9 100644
--- a/node_modules/xmlbuilder/lib/index.js
+++ b/node_modules/xmlbuilder/lib/index.js
@@ -1,53 +1,14 @@
-// Generated by CoffeeScript 1.10.0
+// Generated by CoffeeScript 1.9.1
(function() {
- var XMLDocument, XMLDocumentCB, XMLStreamWriter, XMLStringWriter, assign, isFunction, ref;
+ var XMLBuilder, assign;
- ref = require('./Utility'), assign = ref.assign, isFunction = ref.isFunction;
+ assign = require('lodash/assign');
- XMLDocument = require('./XMLDocument');
-
- XMLDocumentCB = require('./XMLDocumentCB');
-
- XMLStringWriter = require('./XMLStringWriter');
-
- XMLStreamWriter = require('./XMLStreamWriter');
+ XMLBuilder = require('./XMLBuilder');
module.exports.create = function(name, xmldec, doctype, options) {
- var doc, root;
- if (name == null) {
- throw new Error("Root element needs a name");
- }
options = assign({}, xmldec, doctype, options);
- doc = new XMLDocument(options);
- root = doc.element(name);
- if (!options.headless) {
- doc.declaration(options);
- if ((options.pubID != null) || (options.sysID != null)) {
- doc.doctype(options);
- }
- }
- return root;
- };
-
- module.exports.begin = function(options, onData, onEnd) {
- var ref1;
- if (isFunction(options)) {
- ref1 = [options, onData], onData = ref1[0], onEnd = ref1[1];
- options = {};
- }
- if (onData) {
- return new XMLDocumentCB(options, onData, onEnd);
- } else {
- return new XMLDocument(options);
- }
- };
-
- module.exports.stringWriter = function(options) {
- return new XMLStringWriter(options);
- };
-
- module.exports.streamWriter = function(stream, options) {
- return new XMLStreamWriter(stream, options);
+ return new XMLBuilder(name, options).root();
};
}).call(this);