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

pull-json-parse

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pull-json-parse - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

20

index.js

@@ -6,2 +6,3 @@ 'use strict';

var BRACKET_END = 0x5d;
var NEWLINE = 0xa;

@@ -18,2 +19,4 @@ module.exports = parse;

var line = '';
var cc = 0;
var ll = 0;

@@ -60,9 +63,16 @@ return function again( abort, cb ){

if (line.length === 1 && (line.charCodeAt(0) === BRACKET_START || line.charCodeAt(0) === BRACKET_END))
ll = line.length;
if (ll === 0)
continue;
/*
Optimization: find next `ni`, if non and query is
empty, callback directly and avoid queue overhead
*/
if (ll === 1) {
cc = line.charCodeAt(0);
if (cc === BRACKET_START
|| cc === BRACKET_END
|| cc === NEWLINE)
continue;
}
queue.push(JSON.parse(line));

@@ -69,0 +79,0 @@ }

{
"name": "pull-json-parse",
"description": "Parse a pull-stream with newline delimited JSON",
"version": "0.0.2",
"version": "0.0.3",
"repository": "srcagency/pull-json-parse",

@@ -6,0 +6,0 @@ "scripts": {

@@ -26,2 +26,6 @@ 'use strict';

[ '"ping"', [ 'ping' ] ],
[ '[\n]', [] ],
[ '[\n\n]', [] ],
[ '[\ntrue\n\n]', [ true ] ],
[ '[\n|\ntrue\n|\n|\n\n|\n]', [ true ] ],
].forEach(function( set ){

@@ -51,2 +55,2 @@ test(function( t ){

);
})
});
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