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

saxophone

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

saxophone - npm Package Compare versions

Comparing version 0.7.0 to 0.7.1

lib/util.js

6

CHANGELOG.md
<!-- vim: set spelllang=en : -->
# Changelog
## v0.7.1
### Fixed bugs
* Fix parse error on attribute values containing '>'
## v0.7.0

@@ -5,0 +11,0 @@

1

lib/index.js

@@ -7,2 +7,1 @@ const Saxophone = require('./Saxophone');

module.exports = Saxophone;
const {Writable} = require('readable-stream');
const {StringDecoder} = require('string_decoder');
const {findIndexOutside} = require('./util');

@@ -345,3 +346,5 @@ /**

// Recognize regular tags (< ... >)
const tagClose = input.indexOf('>', chunkPos);
const tagClose = findIndexOutside(
input, char => char === '>',
'"', chunkPos);

@@ -348,0 +351,0 @@ if (tagClose === -1) {

@@ -211,3 +211,3 @@ const {Readable} = require('readable-stream');

test('should parse tags containing attributes', assert => {
test('should parse tags with attributes', assert => {
expectEvents(assert,

@@ -223,2 +223,11 @@ '<tag first="one" second="two" third="three " /><other attr="value"></other>',

test('should parse tags with attributes containing ">"', assert => {
expectEvents(assert,
'<tag assert="5 > 1" />',
[
['tagopen', {name: 'tag', attrs: ' assert="5 > 1" ', isSelfClosing: true}],
]
);
});
test('should parse text nodes', assert => {

@@ -225,0 +234,0 @@ expectEvents(assert,

@@ -1,10 +0,2 @@

/**
* Check if a character is a whitespace character according
* to the XML spec (space, carriage return, line feed or tab)
*
* @param {string} character Character to check
* @return {bool} Whether the character is whitespace or not
*/
const isWhitespace = character => character === ' ' ||
character === '\r' || character === '\n' || character === '\t';
const {isWhitespace} = require('../util');

@@ -25,3 +17,3 @@ /**

while (position < end) {
// skip all whitespace
// Skip all whitespace
if (isWhitespace(input[position])) {

@@ -32,3 +24,3 @@ position += 1;

// check that the attribute name contains valid chars
// Check that the attribute name contains valid chars
const startName = position;

@@ -44,3 +36,3 @@

// this is XML so we need a value for the attribute
// This is XML, so we need a value for the attribute
if (position === end) {

@@ -47,0 +39,0 @@ throw new Error('Expected a value for the attribute');

{
"name": "saxophone",
"description": "Fast and lightweight event-driven XML parser in pure JavaScript",
"version": "0.7.0",
"version": "0.7.1",
"license": "MIT",

@@ -16,3 +16,3 @@ "main": "lib/index.js",

"coverage": "nyc --reporter=html --reporter=text npm --silent run tape",
"coveralls": "nyc report --reporter=text-lcov | coveralls",
"coveralls": "nyc report --reporter=lcov",
"benchmark": "node benchmark"

@@ -47,3 +47,2 @@ },

"common-tags": "^1.8.0",
"coveralls": "^3.1.0",
"eslint": "^7.15.0",

@@ -50,0 +49,0 @@ "faucet": "0.0.1",

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