Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

xmldoc

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

xmldoc - npm Package Compare versions

Comparing version 0.4.0 to 0.5.0

.travis.yml

34

lib/xmldoc.js

@@ -5,3 +5,3 @@ (function () {

if (typeof module !== 'undefined' && module.exports) {
if (typeof module !== 'undefined' && module.exports && !GLOBAL.xmldocAssumeBrowser) {
// We're being used in a Node-like environment

@@ -28,5 +28,6 @@ sax = require('sax');

this.name = tag.name;
this.attr = tag.attributes || {};
this.attr = tag.attributes;
this.val = "";
this.isValCdata = false;
this.isValComment = false;
this.children = [];

@@ -64,12 +65,15 @@ this.firstChild = null;

XmlElement.prototype._text = function(text) {
if (text) this.val += text;
this.val += text;
};
XmlElement.prototype._cdata = function(cdata) {
if (cdata) {
this.val += cdata;
this.isValCdata=true;
}
this.val += cdata;
this.isValCdata=true;
};
XmlElement.prototype._comment = function(comment) {
this.val += comment;
this.isValComment=true;
}
XmlElement.prototype._error = function(err) {

@@ -232,2 +236,3 @@ throw err;

parser.oncdata = parser_cdata;
parser.oncomment = parser_comment;
parser.onerror = parser_error;

@@ -237,7 +242,8 @@ }

// create these closures and cache them by keeping them file-scoped
function parser_opentag() { delegates[0]._opentag.apply(delegates[0],arguments) }
function parser_closetag() { delegates[0]._closetag.apply(delegates[0],arguments) }
function parser_text() { delegates[0]._text.apply(delegates[0],arguments) }
function parser_cdata() { delegates[0]._cdata.apply(delegates[0],arguments) }
function parser_error() { delegates[0]._error.apply(delegates[0],arguments) }
function parser_opentag() { delegates[0] && delegates[0]._opentag.apply(delegates[0],arguments) }
function parser_closetag() { delegates[0] && delegates[0]._closetag.apply(delegates[0],arguments) }
function parser_text() { delegates[0] && delegates[0]._text.apply(delegates[0],arguments) }
function parser_cdata() { delegates[0] && delegates[0]._cdata.apply(delegates[0],arguments) }
function parser_comment() { delegates[0] && delegates[0]._comment.apply(delegates[0],arguments) }
function parser_error() { delegates[0] && delegates[0]._error.apply(delegates[0],arguments) }

@@ -253,7 +259,7 @@ // a relatively standard extend method

function escapeXML(value){
return value.replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/&/g, '&amp;').replace(/'/g, '&apos;').replace(/"/g, '&quot;');
return value.replace(/&/g, '&amp;').replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/'/g, '&apos;').replace(/"/g, '&quot;');
}
// Are we being used in a Node-like environment?
if (typeof module !== 'undefined' && module.exports)
if (typeof module !== 'undefined' && module.exports && !GLOBAL.xmldocAssumeBrowser)
module.exports.XmlDocument = XmlDocument;

@@ -260,0 +266,0 @@ else

@@ -9,4 +9,8 @@ {

},
"version": "0.4.0",
"version": "0.5.0",
"main": "./index",
"scripts": {
"test": "tap test/*.js",
"coverage": "npm test -- --cov --coverage-report=html"
},
"dependencies": {

@@ -29,3 +33,6 @@ "sax": "~1.1.1"

],
"readmeFilename": "README.md"
"readmeFilename": "README.md",
"devDependencies": {
"tap": "^5.7.1"
}
}
[![Build Status](https://travis-ci.org/nfarina/xmldoc.svg)](https://travis-ci.org/nfarina/xmldoc)
[![Coverage Status](https://coveralls.io/repos/github/nfarina/xmldoc/badge.svg?branch=master)](https://coveralls.io/github/nfarina/xmldoc?branch=master)
## Introduction

@@ -3,0 +6,0 @@

Sorry, the diff of this file is not supported yet

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