json-stream-stringify
Advanced tools
Comparing version 3.1.2 to 3.1.3
@@ -575,2 +575,4 @@ 'use strict'; | ||
async _read(size) { | ||
if (this.readState === ReadState.Consumed) return; | ||
if (this.readState !== ReadState.NotReading) { | ||
@@ -585,3 +587,3 @@ this.readState = ReadState.ReadMore; | ||
while (!this.pushCalled && this.item !== this.root && !this.destroyed) { | ||
while (!this.pushCalled && this.item !== this.root && this.buffer !== undefined) { | ||
p = this.item.read(size); // eslint-disable-next-line no-await-in-loop | ||
@@ -592,2 +594,4 @@ | ||
if (this.buffer === undefined) return; | ||
if (this.item === this.root) { | ||
@@ -597,4 +601,3 @@ if (this.buffer.length) this.push(this.buffer); | ||
this.readState = ReadState.Consumed; | ||
this._destroy(); | ||
this.cleanup(); | ||
} | ||
@@ -611,7 +614,8 @@ | ||
_destroy() { | ||
this.destroyed = true; | ||
cleanup() { | ||
this.readState = ReadState.Consumed; | ||
this.buffer = undefined; | ||
this.visited = undefined; | ||
this.item = undefined; | ||
this.root = undefined; | ||
this.prePush = undefined; | ||
@@ -625,5 +629,3 @@ } | ||
(_super$destroy = super.destroy) === null || _super$destroy === void 0 ? void 0 : _super$destroy.call(this); | ||
this._destroy(); | ||
this.cleanup(); | ||
return this; | ||
@@ -630,0 +632,0 @@ } |
@@ -572,2 +572,4 @@ 'use strict'; | ||
async _read(size) { | ||
if (this.readState === ReadState.Consumed) return; | ||
if (this.readState !== ReadState.NotReading) { | ||
@@ -582,3 +584,3 @@ this.readState = ReadState.ReadMore; | ||
while (!this.pushCalled && this.item !== this.root && !this.destroyed) { | ||
while (!this.pushCalled && this.item !== this.root && this.buffer !== undefined) { | ||
p = this.item.read(size); // eslint-disable-next-line no-await-in-loop | ||
@@ -589,2 +591,4 @@ | ||
if (this.buffer === undefined) return; | ||
if (this.item === this.root) { | ||
@@ -594,4 +598,3 @@ if (this.buffer.length) this.push(this.buffer); | ||
this.readState = ReadState.Consumed; | ||
this._destroy(); | ||
this.cleanup(); | ||
} | ||
@@ -608,7 +611,8 @@ | ||
_destroy() { | ||
this.destroyed = true; | ||
cleanup() { | ||
this.readState = ReadState.Consumed; | ||
this.buffer = undefined; | ||
this.visited = undefined; | ||
this.item = undefined; | ||
this.root = undefined; | ||
this.prePush = undefined; | ||
@@ -622,5 +626,3 @@ } | ||
(_super$destroy = super.destroy) === null || _super$destroy === void 0 ? void 0 : _super$destroy.call(this); | ||
this._destroy(); | ||
this.cleanup(); | ||
return this; | ||
@@ -627,0 +629,0 @@ } |
@@ -44,3 +44,3 @@ import { Readable } from 'stream'; | ||
_read(size?: number): Promise<void>; | ||
_destroy(): void; | ||
private cleanup; | ||
destroy(error?: Error): this; | ||
@@ -47,0 +47,0 @@ } |
@@ -575,2 +575,4 @@ (function (global, factory) { | ||
async _read(size) { | ||
if (this.readState === ReadState.Consumed) return; | ||
if (this.readState !== ReadState.NotReading) { | ||
@@ -585,3 +587,3 @@ this.readState = ReadState.ReadMore; | ||
while (!this.pushCalled && this.item !== this.root && !this.destroyed) { | ||
while (!this.pushCalled && this.item !== this.root && this.buffer !== undefined) { | ||
p = this.item.read(size); // eslint-disable-next-line no-await-in-loop | ||
@@ -592,2 +594,4 @@ | ||
if (this.buffer === undefined) return; | ||
if (this.item === this.root) { | ||
@@ -597,4 +601,3 @@ if (this.buffer.length) this.push(this.buffer); | ||
this.readState = ReadState.Consumed; | ||
this._destroy(); | ||
this.cleanup(); | ||
} | ||
@@ -611,7 +614,8 @@ | ||
_destroy() { | ||
this.destroyed = true; | ||
cleanup() { | ||
this.readState = ReadState.Consumed; | ||
this.buffer = undefined; | ||
this.visited = undefined; | ||
this.item = undefined; | ||
this.root = undefined; | ||
this.prePush = undefined; | ||
@@ -625,5 +629,3 @@ } | ||
(_super$destroy = super.destroy) === null || _super$destroy === void 0 ? void 0 : _super$destroy.call(this); | ||
this._destroy(); | ||
this.cleanup(); | ||
return this; | ||
@@ -630,0 +632,0 @@ } |
@@ -564,2 +564,4 @@ (function (global, factory) { | ||
async _read(size) { | ||
if (this.readState === ReadState.Consumed) return; | ||
if (this.readState !== ReadState.NotReading) { | ||
@@ -574,3 +576,3 @@ this.readState = ReadState.ReadMore; | ||
while (!this.pushCalled && this.item !== this.root && !this.destroyed) { | ||
while (!this.pushCalled && this.item !== this.root && this.buffer !== undefined) { | ||
p = this.item.read(size); // eslint-disable-next-line no-await-in-loop | ||
@@ -581,2 +583,4 @@ | ||
if (this.buffer === undefined) return; | ||
if (this.item === this.root) { | ||
@@ -586,4 +590,3 @@ if (this.buffer.length) this.push(this.buffer); | ||
this.readState = ReadState.Consumed; | ||
this._destroy(); | ||
this.cleanup(); | ||
} | ||
@@ -600,7 +603,8 @@ | ||
_destroy() { | ||
this.destroyed = true; | ||
cleanup() { | ||
this.readState = ReadState.Consumed; | ||
this.buffer = undefined; | ||
this.visited = undefined; | ||
this.item = undefined; | ||
this.root = undefined; | ||
this.prePush = undefined; | ||
@@ -614,5 +618,3 @@ } | ||
(_super$destroy = super.destroy) === null || _super$destroy === void 0 ? void 0 : _super$destroy.call(this); | ||
this._destroy(); | ||
this.cleanup(); | ||
return this; | ||
@@ -619,0 +621,0 @@ } |
{ | ||
"name": "json-stream-stringify", | ||
"description": "JSON.Stringify as a readable stream", | ||
"version": "3.1.2", | ||
"version": "3.1.3", | ||
"license": "MIT", | ||
@@ -74,3 +74,3 @@ "author": "Faleij <faleij@gmail.com> (https://github.com/faleij)", | ||
"volta": { | ||
"node": "18.19.0" | ||
"node": "18.19.1" | ||
}, | ||
@@ -77,0 +77,0 @@ "engines": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
348646
2967