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

JSONStream

Package Overview
Dependencies
Maintainers
2
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

JSONStream - npm Package Compare versions

Comparing version 1.1.4 to 1.2.0

test/error_contents.js

34

index.js

@@ -18,3 +18,3 @@ #! /usr/bin/env node

exports.parse = function (path, map) {
var header, footer
var parser = new Parser()

@@ -29,2 +29,6 @@ var stream = through(function (chunk) {

stream.write(data)
if (header)
stream.emit('header', header)
if (footer)
stream.emit('footer', footer)
stream.queue(null)

@@ -67,3 +71,6 @@ })

if (!c) return
if (! check(key, c.key)) return
if (! check(key, c.key)) {
setHeaderFooter(c.key, value)
return
}
emitKey = !!key.emitKey;

@@ -83,2 +90,4 @@ i++

break
} else {
setHeaderFooter(c.key, value)
}

@@ -104,2 +113,8 @@ j++

this.stack[k].value = null
// emit header
if (header) {
stream.emit('header', header);
header = false;
}
}

@@ -126,4 +141,17 @@ parser._onToken = parser.onToken;

return stream
return stream
function setHeaderFooter(key, value) {
// header has not been emitted yet
if (header !== false) {
header = header || {}
header[key] = value
}
// footer has not been emitted yet but header has
if (footer !== false && header === false) {
footer = footer || {}
footer[key] = value
}
}
}

@@ -130,0 +158,0 @@

2

package.json
{
"name": "JSONStream",
"version": "1.1.4",
"version": "1.2.0",
"description": "rawStream.pipe(JSONStream.parse()).pipe(streamOfObjects)",

@@ -5,0 +5,0 @@ "homepage": "http://github.com/dominictarr/JSONStream",

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