Socket
Socket
Sign inDemoInstall

sax

Package Overview
Dependencies
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sax - npm Package Compare versions

Comparing version 0.5.4 to 0.5.5

test/utf8-split.js

15

lib/sax.js

@@ -182,2 +182,4 @@ // wrapper for non-node envs

this._decoder = null;
streamWraps.forEach(function (ev) {

@@ -203,2 +205,12 @@ Object.defineProperty(me, "on" + ev, {

SAXStream.prototype.write = function (data) {
if (typeof Buffer === 'function' &&
typeof Buffer.isBuffer === 'function' &&
Buffer.isBuffer(data)) {
if (!this._decoder) {
var SD = require('string_decoder').StringDecoder
this._decoder = new SD('utf8')
}
data = this._decoder.write(data);
}
this._parser.write(data.toString())

@@ -210,3 +222,4 @@ this.emit("data", data)

SAXStream.prototype.end = function (chunk) {
if (chunk && chunk.length) this._parser.write(chunk.toString())
if (chunk && chunk.length) this.write(chunk)
else if (this.leftovers) this._parser.write(this.leftovers.toString())
this._parser.end()

@@ -213,0 +226,0 @@ return true

2

package.json

@@ -5,3 +5,3 @@ {

"author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
"version": "0.5.4",
"version": "0.5.5",
"main": "lib/sax.js",

@@ -8,0 +8,0 @@ "license": "BSD",

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