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 0.2.0 to 0.2.1

1

lib/XMLBuilder.js

@@ -60,2 +60,3 @@ (function() {

root = new XMLFragment(this, name, {});
root.isRoot = true;
this.children.push(root);

@@ -62,0 +63,0 @@ return root;

30

lib/XMLFragment.js

@@ -6,2 +6,3 @@ (function() {

function XMLFragment(parent, name, attributes, text) {
this.isRoot = false;
this.parent = parent;

@@ -48,2 +49,5 @@ this.name = name;

var child, i, key, val, _ref, _ref2;
if (this.isRoot) {
throw new Error("Cannot insert elements at root level");
}
if (!(name != null)) {

@@ -83,2 +87,5 @@ throw new Error("Missing element name");

var child, i, key, val, _ref, _ref2;
if (this.isRoot) {
throw new Error("Cannot insert elements at root level");
}
if (!(name != null)) {

@@ -118,3 +125,3 @@ throw new Error("Missing element name");

var i, _ref;
if (!(this.parent != null)) {
if (this.isRoot) {
throw new Error("Cannot remove the root element");

@@ -178,3 +185,3 @@ }

XMLFragment.prototype.up = function() {
if (!(this.parent != null)) {
if (this.isRoot) {
throw new Error("This node has no parent");

@@ -184,6 +191,17 @@ }

};
XMLFragment.prototype.root = function() {
var child;
if (this.isRoot) {
return this;
}
child = this.parent;
while (!child.isRoot) {
child = child.parent;
}
return child;
};
XMLFragment.prototype.prev = function() {
var i;
if (!(this.parent != null)) {
throw new Error("This node has no parent");
if (this.isRoot) {
throw new Error("Root node has no siblings");
}

@@ -198,4 +216,4 @@ i = this.parent.children.indexOf(this);

var i;
if (!(this.parent != null)) {
throw new Error("This node has no parent");
if (this.isRoot) {
throw new Error("Root node has no siblings");
}

@@ -202,0 +220,0 @@ i = this.parent.children.indexOf(this);

{
"name": "xmlbuilder",
"version": "0.2.0",
"version": "0.2.1",
"keywords": "xml xmlbuilder",

@@ -14,8 +14,6 @@ "homepage": "http://github.com/oozcitak/xmlbuilder-js",

],
"repositories": [
{
"type": "git",
"url": "git://github.com/oozcitak/xmlbuilder-js.git"
}
],
"repository": {
"type": "git",
"url": "git://github.com/oozcitak/xmlbuilder-js.git"
},
"bugs": {

@@ -22,0 +20,0 @@ "url": "http://github.com/oozcitak/xmlbuilder-js/issues"

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc