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

stream-json

Package Overview
Dependencies
Maintainers
1
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stream-json - npm Package Compare versions

Comparing version 1.7.4 to 1.7.5

2

package.json
{
"name": "stream-json",
"version": "1.7.4",
"version": "1.7.5",
"description": "stream-json is the micro-library of Node.js stream components for creating custom JSON processing pipelines with a minimal memory footprint. It can parse JSON files far exceeding available memory streaming individual primitives using a SAX-inspired API. Includes utilities to stream JSON database dumps.",

@@ -5,0 +5,0 @@ "homepage": "http://github.com/uhop/stream-json",

@@ -116,2 +116,3 @@ # stream-json [![NPM version][npm-image]][npm-url]

- 1.7.5 *fixed a stringer bug with ASCII control symbols. Thx, [Kraicheck](https://github.com/Kraicheck).*
- 1.7.4 *updated dependency (`stream-chain`), bugfix: inconsistent object/array braces. Thx [Xiao Li](https://github.com/xli1000).*

@@ -124,38 +125,3 @@ - 1.7.3 *added an assembler option to treat numbers as strings.*

- 1.6.0 *added `jsonl/Parser` and `jsonl/Stringer`.*
- 1.5.0 *`Disassembler` and streamers now follow `JSON.stringify()` and `JSON.parse()` protocols respectively including `replacer` and `reviver`.*
- 1.4.1 *bugfix: `Stringer` with `makeArray` should produce empty array if no input.*
- 1.4.0 *added `makeArray` functionality to `Stringer`. Thx all who asked for it!*
- 1.3.3 *bugfix: very large/infinite streams with garbage didn't fail. Thx [Arne Marschall](https://github.com/Disco1267).*
- 1.3.2 *bugfix: filters could fail with packed-only token streams. Thx [Trey Brisbane](https://github.com/treybrisbane).*
- 1.3.1 *bugfix: reverted the last bugfix in `Verifier`, a bugfix in tests, thx [Guillermo Ares](https://github.com/guillermoares).*
- 1.3.0 *added `Batch`, a bugfix in `Verifier`.*
- 1.2.1 *the technical release.*
- 1.2.0 *added `Verifier`.*
- 1.1.4 *fixed `Filter` going haywire, thx [@codebling](https://github.com/codebling).*
- 1.1.3 *fixed `Parser` streaming numbers when shouldn't, thx [Grzegorz Lachowski](https://github.com/gregolsky).*
- 1.1.2 *fixed `Stringer` not escaping some symbols, thx [Pavel Bardov](https://github.com/pbardov).*
- 1.1.1 *minor updates in docs and comments.*
- 1.1.0 *added `Disassembler`.*
- 1.0.3 *minor tweaks, added TypeScript typings and the badge.*
- 1.0.2 *minor tweaks, documentation improvements.*
- 1.0.1 *reorg to fix export problems.*
- 1.0.0 *the first 1.0 release.*
- 0.6.1 *the technical release.*
- 0.6.0 *added Stringer to convert event streams back to JSON.*
- 0.5.3 *bug fix to allow empty JSON Streaming.*
- 0.5.2 *bug fixes in `Filter`.*
- 0.5.1 *corrected README.*
- 0.5.0 *added support for [JSON Streaming](https://en.wikipedia.org/wiki/JSON_Streaming).*
- 0.4.2 *refreshed dependencies.*
- 0.4.1 *added `StreamObject` by [Sam Noedel](https://github.com/delta62).*
- 0.4.0 *new high-performant Combo component, switched to the previous parser.*
- 0.3.0 *new even faster parser, bug fixes.*
- 0.2.2 *refreshed dependencies.*
- 0.2.1 *added utilities to filter objects on the fly.*
- 0.2.0 *new faster parser, formal unit tests, added utilities to assemble objects on the fly.*
- 0.1.0 *bug fixes, more documentation.*
- 0.0.5 *bug fixes.*
- 0.0.4 *improved grammar.*
- 0.0.3 *the technical release.*
- 0.0.2 *bug fixes.*
- 0.0.1 *the initial release.*
The rest can be consulted in the project's wiki [Release history](https://github.com/uhop/stream-json/wiki/Release-history).

@@ -29,3 +29,3 @@ 'use strict';

const skipValue = endName =>
function(chunk, encoding, callback) {
function (chunk, encoding, callback) {
if (chunk.name === endName) {

@@ -38,3 +38,6 @@ this._transform = this._prev_transform;

const replaceSymbols = {'\b': '\\b', '\f': '\\f', '\n': '\\n', '\r': '\\r', '\t': '\\t', '"': '\\"', '\\': '\\\\'};
const sanitizeString = value => value.replace(/[\b\f\n\r\t\"\\]/g, match => replaceSymbols[match]);
const sanitizeString = value =>
value.replace(/[\b\f\n\r\t\"\\\u0000-\u001F\u007F-\u009F]/g, match =>
replaceSymbols.hasOwnProperty(match) ? replaceSymbols[match] : '\\u' + ('0000' + match.charCodeAt(0).toString(16)).slice(-4)
);

@@ -92,3 +95,3 @@ const doNothing = () => {};

case 'stringValue':
this.push('"' + sanitizeString(chunk.value)+ '"');
this.push('"' + sanitizeString(chunk.value) + '"');
break;

@@ -95,0 +98,0 @@ case 'numberValue':

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