Socket
Socket
Sign inDemoInstall

xmlbuilder

Package Overview
Dependencies
Maintainers
1
Versions
98
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

xmlbuilder - npm Package Compare versions

Comparing version 2.2.1 to 2.3.0

6

lib/index.js
// Generated by CoffeeScript 1.6.3
(function() {
var XMLBuilder, _;
var XMLBuilder, assign;
_ = require('lodash-node');
assign = require('lodash.assign');

@@ -10,3 +10,3 @@ XMLBuilder = require('./XMLBuilder');

module.exports.create = function(name, xmldec, doctype, options) {
options = _.extend({}, xmldec, doctype, options);
options = assign({}, xmldec, doctype, options);
return new XMLBuilder(name, options).root();

@@ -13,0 +13,0 @@ };

// Generated by CoffeeScript 1.6.3
(function() {
var XMLAttribute, _;
var XMLAttribute, create;
_ = require('lodash-node');
create = require('lodash.create');

@@ -21,3 +21,3 @@ module.exports = XMLAttribute = (function() {

XMLAttribute.prototype.clone = function() {
return _.create(XMLAttribute.prototype, this);
return create(XMLAttribute.prototype, this);
};

@@ -24,0 +24,0 @@

// Generated by CoffeeScript 1.6.3
(function() {
var XMLBuilder, XMLDeclaration, XMLDocType, XMLElement, XMLStringifier, _;
var XMLBuilder, XMLDeclaration, XMLDocType, XMLElement, XMLStringifier;
_ = require('lodash-node');
XMLStringifier = require('./XMLStringifier');

@@ -8,0 +6,0 @@

// Generated by CoffeeScript 1.6.3
(function() {
var XMLCData, XMLNode, _,
var XMLCData, XMLNode, create,
__hasProp = {}.hasOwnProperty,
__extends = 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; };
_ = require('lodash-node');
create = require('lodash.create');

@@ -23,3 +23,3 @@ XMLNode = require('./XMLNode');

XMLCData.prototype.clone = function() {
return _.create(XMLCData.prototype, this);
return create(XMLCData.prototype, this);
};

@@ -26,0 +26,0 @@

// Generated by CoffeeScript 1.6.3
(function() {
var XMLComment, XMLNode, _,
var XMLComment, XMLNode, create,
__hasProp = {}.hasOwnProperty,
__extends = 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; };
_ = require('lodash-node');
create = require('lodash.create');

@@ -23,3 +23,3 @@ XMLNode = require('./XMLNode');

XMLComment.prototype.clone = function() {
return _.create(XMLComment.prototype, this);
return create(XMLComment.prototype, this);
};

@@ -26,0 +26,0 @@

// Generated by CoffeeScript 1.6.3
(function() {
var XMLDeclaration, XMLNode, _,
var XMLDeclaration, XMLNode, create, isObject,
__hasProp = {}.hasOwnProperty,
__extends = 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; };
_ = require('lodash-node');
create = require('lodash.create');
isObject = require('lodash.isobject');
XMLNode = require('./XMLNode');

@@ -17,3 +19,3 @@

XMLDeclaration.__super__.constructor.call(this, parent);
if (_.isObject(version)) {
if (isObject(version)) {
_ref = version, version = _ref.version, encoding = _ref.encoding, standalone = _ref.standalone;

@@ -36,3 +38,3 @@ }

XMLDeclaration.prototype.clone = function() {
return _.create(XMLDeclaration.prototype, this);
return create(XMLDeclaration.prototype, this);
};

@@ -39,0 +41,0 @@

// Generated by CoffeeScript 1.6.3
(function() {
var XMLDocType, _;
var XMLDocType, create, isObject;
_ = require('lodash-node');
create = require('lodash.create');
isObject = require('lodash.isobject');
module.exports = XMLDocType = (function() {

@@ -13,3 +15,3 @@ function XMLDocType(parent, pubID, sysID) {

this.children = [];
if (_.isObject(pubID)) {
if (isObject(pubID)) {
_ref = pubID, pubID = _ref.pubID, sysID = _ref.sysID;

@@ -29,3 +31,3 @@ }

XMLDocType.prototype.clone = function() {
return _.create(XMLDocType.prototype, this);
return create(XMLDocType.prototype, this);
};

@@ -32,0 +34,0 @@

// Generated by CoffeeScript 1.6.3
(function() {
var XMLDTDAttList, _;
var XMLDTDAttList, create;
_ = require('lodash-node');
create = require('lodash.create');

@@ -39,3 +39,3 @@ module.exports = XMLDTDAttList = (function() {

XMLDTDAttList.prototype.clone = function() {
return _.create(XMLDTDAttList.prototype, this);
return create(XMLDTDAttList.prototype, this);
};

@@ -42,0 +42,0 @@

// Generated by CoffeeScript 1.6.3
(function() {
var XMLDTDElement, _;
var XMLDTDElement, create, isArray;
_ = require('lodash-node');
create = require('lodash.create');
isArray = require('lodash.isarray');
module.exports = XMLDTDElement = (function() {

@@ -16,3 +18,3 @@ function XMLDTDElement(parent, name, value) {

}
if (_.isArray(value)) {
if (isArray(value)) {
value = '(' + value.join(',') + ')';

@@ -25,3 +27,3 @@ }

XMLDTDElement.prototype.clone = function() {
return _.create(XMLDTDElement.prototype, this);
return create(XMLDTDElement.prototype, this);
};

@@ -28,0 +30,0 @@

// Generated by CoffeeScript 1.6.3
(function() {
var XMLDTDEntity, _;
var XMLDTDEntity, create, isObject;
_ = require('lodash-node');
create = require('lodash.create');
isObject = require('lodash.isobject');
module.exports = XMLDTDEntity = (function() {

@@ -18,3 +20,3 @@ function XMLDTDEntity(parent, pe, name, value) {

this.name = this.stringify.eleName(name);
if (!_.isObject(value)) {
if (!isObject(value)) {
this.value = this.stringify.dtdEntityValue(value);

@@ -44,3 +46,3 @@ } else {

XMLDTDEntity.prototype.clone = function() {
return _.create(XMLDTDEntity.prototype, this);
return create(XMLDTDEntity.prototype, this);
};

@@ -47,0 +49,0 @@

// Generated by CoffeeScript 1.6.3
(function() {
var XMLDTDNotation, _;
var XMLDTDNotation, create;
_ = require('lodash-node');
create = require('lodash.create');

@@ -26,3 +26,3 @@ module.exports = XMLDTDNotation = (function() {

XMLDTDNotation.prototype.clone = function() {
return _.create(XMLDTDNotation.prototype, this);
return create(XMLDTDNotation.prototype, this);
};

@@ -29,0 +29,0 @@

// Generated by CoffeeScript 1.6.3
(function() {
var XMLAttribute, XMLElement, XMLNode, XMLProcessingInstruction, _,
var XMLAttribute, XMLElement, XMLNode, XMLProcessingInstruction, create, isArray, isFunction, isObject,
__hasProp = {}.hasOwnProperty,
__extends = 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; };
_ = require('lodash-node');
create = require('lodash.create');
isObject = require('lodash.isobject');
isArray = require('lodash.isarray');
isFunction = require('lodash.isfunction');
XMLNode = require('./XMLNode');

@@ -34,3 +40,3 @@

var att, attName, clonedSelf, pi, _i, _len, _ref, _ref1;
clonedSelf = _.create(XMLElement.prototype, this);
clonedSelf = create(XMLElement.prototype, this);
clonedSelf.attributes = {};

@@ -61,3 +67,6 @@ _ref = this.attributes;

var attName, attValue;
if (_.isObject(name)) {
if (name != null) {
name = name.valueOf();
}
if (isObject(name)) {
for (attName in name) {

@@ -69,3 +78,3 @@ if (!__hasProp.call(name, attName)) continue;

} else {
if (_.isFunction(value)) {
if (isFunction(value)) {
value = value.apply();

@@ -85,3 +94,4 @@ }

}
if (_.isArray(name)) {
name = name.valueOf();
if (isArray(name)) {
for (_i = 0, _len = name.length; _i < _len; _i++) {

@@ -99,3 +109,9 @@ attName = name[_i];

var insTarget, insValue, instruction, _i, _len;
if (_.isArray(target)) {
if (target != null) {
target = target.valueOf();
}
if (value != null) {
value = value.valueOf();
}
if (isArray(target)) {
for (_i = 0, _len = target.length; _i < _len; _i++) {

@@ -105,3 +121,3 @@ insTarget = target[_i];

}
} else if (_.isObject(target)) {
} else if (isObject(target)) {
for (insTarget in target) {

@@ -113,3 +129,3 @@ if (!__hasProp.call(target, insTarget)) continue;

} else {
if (_.isFunction(value)) {
if (isFunction(value)) {
value = value.apply();

@@ -116,0 +132,0 @@ }

// Generated by CoffeeScript 1.6.3
(function() {
var XMLNode, _,
var XMLNode, isArray, isEmpty, isFunction, isObject,
__hasProp = {}.hasOwnProperty;
_ = require('lodash-node');
isObject = require('lodash.isobject');
isArray = require('lodash.isarray');
isFunction = require('lodash.isfunction');
isEmpty = require('lodash.isempty');
module.exports = XMLNode = (function() {

@@ -25,6 +31,10 @@ function XMLNode(parent) {

}
if (!_.isObject(attributes)) {
attributes = attributes.valueOf();
if (!isObject(attributes)) {
_ref = [attributes, text], text = _ref[0], attributes = _ref[1];
}
if (_.isArray(name)) {
if (name != null) {
name = name.valueOf();
}
if (isArray(name)) {
for (_i = 0, _len = name.length; _i < _len; _i++) {

@@ -34,14 +44,14 @@ item = name[_i];

}
} else if (_.isFunction(name)) {
} else if (isFunction(name)) {
lastChild = this.element(name.apply());
} else if (_.isObject(name)) {
} else if (isObject(name)) {
for (key in name) {
if (!__hasProp.call(name, key)) continue;
val = name[key];
if (!(val != null)) {
continue;
}
if (_.isFunction(val)) {
if (isFunction(val)) {
val = val.apply();
}
if ((isObject(val)) && (isEmpty(val))) {
val = null;
}
if (!this.options.ignoreDecorators && this.stringify.convertAttKey && key.indexOf(this.stringify.convertAttKey) === 0) {

@@ -51,4 +61,4 @@ lastChild = this.attribute(key.substr(this.stringify.convertAttKey.length), val);

lastChild = this.instruction(key.substr(this.stringify.convertPIKey.length), val);
} else if (_.isObject(val)) {
if (!this.options.ignoreDecorators && this.stringify.convertListKey && key.indexOf(this.stringify.convertListKey) === 0 && _.isArray(val)) {
} else if (isObject(val)) {
if (!this.options.ignoreDecorators && this.stringify.convertListKey && key.indexOf(this.stringify.convertListKey) === 0 && isArray(val)) {
lastChild = this.element(val);

@@ -118,6 +128,10 @@ } else {

var XMLElement, child, _ref;
if (name != null) {
name = name.valueOf();
}
if (attributes == null) {
attributes = {};
}
if (!_.isObject(attributes)) {
attributes = attributes.valueOf();
if (!isObject(attributes)) {
_ref = [attributes, text], text = _ref[0], attributes = _ref[1];

@@ -124,0 +138,0 @@ }

// Generated by CoffeeScript 1.6.3
(function() {
var XMLProcessingInstruction, _;
var XMLProcessingInstruction, create;
_ = require('lodash-node');
create = require('lodash.create');

@@ -20,3 +20,3 @@ module.exports = XMLProcessingInstruction = (function() {

XMLProcessingInstruction.prototype.clone = function() {
return _.create(XMLProcessingInstruction.prototype, this);
return create(XMLProcessingInstruction.prototype, this);
};

@@ -23,0 +23,0 @@

// Generated by CoffeeScript 1.6.3
(function() {
var XMLNode, XMLRaw, _,
var XMLNode, XMLRaw, create,
__hasProp = {}.hasOwnProperty,
__extends = 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; };
_ = require('lodash-node');
create = require('lodash.create');

@@ -23,3 +23,3 @@ XMLNode = require('./XMLNode');

XMLRaw.prototype.clone = function() {
return _.create(XMLRaw.prototype, this);
return create(XMLRaw.prototype, this);
};

@@ -26,0 +26,0 @@

// Generated by CoffeeScript 1.6.3
(function() {
var XMLNode, XMLText, _,
var XMLNode, XMLText, create,
__hasProp = {}.hasOwnProperty,
__extends = 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; };
_ = require('lodash-node');
create = require('lodash.create');

@@ -24,3 +24,3 @@ XMLNode = require('./XMLNode');

XMLText.prototype.clone = function() {
return _.create(XMLText.prototype, this);
return create(XMLText.prototype, this);
};

@@ -27,0 +27,0 @@

{
"name": "xmlbuilder",
"version": "2.2.1",
"version": "2.3.0",
"keywords": [

@@ -26,6 +26,11 @@ "xml",

"engines": {
"node": "0.8.x || 0.10.x"
"node": "0.8.x || 0.10.x || 0.11.x"
},
"dependencies": {
"lodash-node": "~2.4.1"
"lodash.assign": "~2.4.1",
"lodash.create": "~2.4.1",
"lodash.isobject": "~2.4.1",
"lodash.isarray": "~2.4.1",
"lodash.isfunction": "~2.4.1",
"lodash.isempty": "~2.4.1"
},

@@ -32,0 +37,0 @@ "devDependencies": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc