Socket
Socket
Sign inDemoInstall

json-stream-stringify

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-stream-stringify - npm Package Compare versions

Comparing version 1.3.3 to 1.3.4

3

jsonStreamify.js

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

for (let obj of this._iter) {
//console.log(obj, insertSeparator);
if (obj.state === 'close') {
insertSeparator = true;
yield this.push(obj.type === Object ? '}' : ']');

@@ -21,0 +24,0 @@ continue;

2

package.json
{
"name": "json-stream-stringify",
"version": "1.3.3",
"version": "1.3.4",
"description": "JSON.Stringify as a readable stream",

@@ -5,0 +5,0 @@ "repository": {

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

depth: 0,
type: this._forcedCtxType || ctxType,
type: ctxType,
next: () => {

@@ -43,0 +43,0 @@ let child = childIterator && childIterator.next();

@@ -83,4 +83,10 @@ 'use strict';

it('{a:[1], "b": 2} should be {"a":[1],"b":2}', createTest({
a: [1], b: 2
}, '{"a":[1],"b":2}'));
it('[] should be []', createTest([], '[]'));
it('[[[]],[[]]] should be [[[]],[[]]]', createTest([[[]],[[]]], '[[[]],[[]]]'));
it('[1, undefined, 2] should be [1,null,2]', createTest([1, undefined, 2], '[1,null,2]'));

@@ -108,3 +114,16 @@

it(`{ a: ReadableStream({name: 'name', date: date }) } should be [{},"a",null,"c"]`, createTest({ a: ReadableStream({name: 'name', date: date }) }, `{"a":[{"name":"name","date":"${date.toJSON()}"}]}`));
it(`{ a: ReadableStream({name: 'name', date: date }) } should be {"a":[{"name":"name","date":"${date.toJSON()}"}]}`, createTest({
a: ReadableStream({
name: 'name',
date: date
})
}, `{"a":[{"name":"name","date":"${date.toJSON()}"}]}`));
it(`{ a: ReadableStream({name: 'name', arr: [], date: date }) } should be {"a":[{"name":"name","arr":[],"date":"${date.toJSON()}"}]}`, createTest({
a: ReadableStream({
name: 'name',
arr: [],
date: date
})
}, `{"a":[{"name":"name","arr":[],"date":"${date.toJSON()}"}]}`));
});
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