Skip to content

Commit 1555b22

Browse files
SlavikPrVyacheslav Skakun
andauthored
Fix: Readable Stream read 16,384 objects (#42)
* Fix: Readable Stream read 16,384 objects in ObjectMode #41 --------- Co-authored-by: Vyacheslav Skakun <[email protected]>
1 parent ec71d61 commit 1555b22

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/JsonStreamStringify.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ function quoteString(string: string) {
126126
return str;
127127
}
128128

129-
function readAsPromised(stream, size) {
129+
function readAsPromised(stream, size?) {
130130
const value = stream.read(size);
131131
if (value === null) {
132132
return new Promise((resolve, reject) => {
@@ -327,10 +327,10 @@ export class JsonStreamStringify extends Readable {
327327
let i = 0;
328328
const item = <any>{
329329
type: 'readable object',
330-
async read(size: number) {
330+
async read() {
331331
try {
332332
let out = '';
333-
const data = await readAsPromised(input, size);
333+
const data = await readAsPromised(input);
334334
if (data === null) {
335335
if (i && that.indent) {
336336
out += `\n${parent.indent}`;

0 commit comments

Comments
 (0)