File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " json-stream-stringify" ,
3
3
"description" : " JSON.Stringify as a readable stream" ,
4
- "version" : " 3.1.2 " ,
4
+ "version" : " 3.1.3 " ,
5
5
"license" : " MIT" ,
6
6
"author" :
" Faleij <[email protected] > (https://github.com/faleij)" ,
7
7
"repository" : {
71
71
"typescript" : " ^4.7.4"
72
72
},
73
73
"volta" : {
74
- "node" : " 18. 16.0 "
74
+ "node" : " 16.20.2 "
75
75
},
76
76
"engines" : {
77
77
"node" : " >=7.10.1"
Original file line number Diff line number Diff line change @@ -494,11 +494,12 @@ export class JsonStreamStringify extends Readable {
494
494
this . readState = ReadState . Reading ;
495
495
this . pushCalled = false ;
496
496
let p ;
497
- while ( ! this . pushCalled && this . item !== this . root && ! this . destroyed ) {
497
+ while ( ! this . pushCalled && this . item !== this . root && this . buffer !== undefined ) {
498
498
p = this . item . read ( size ) ;
499
499
// eslint-disable-next-line no-await-in-loop
500
500
if ( p ) await p ;
501
501
}
502
+ if ( this . buffer === undefined ) return ;
502
503
if ( this . item === this . root ) {
503
504
if ( this . buffer . length ) this . push ( this . buffer ) ;
504
505
this . push ( null ) ;
@@ -513,6 +514,7 @@ export class JsonStreamStringify extends Readable {
513
514
}
514
515
515
516
private cleanup ( ) {
517
+ this . readState = ReadState . Consumed ;
516
518
this . buffer = undefined ;
517
519
this . visited = undefined ;
518
520
this . item = undefined ;
You can’t perform that action at this time.
0 commit comments