MCPcopy Create free account
hub / github.com/Faleij/json-stream-stringify / read

Function read

test-src/JsonStreamStringify.spec.ts:434–451  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

432 let ended = false;
433 read();
434 function read() {
435 if (a.readableEnded) return;
436 for (let i = 0; i < 10; i++) {
437 a._read(); // simulate bad forced read
438 a.read(); // legitimate read call
439 a._read(); // simulate bad forced read
440 if (!(p.writableEnded || ended) && i === 8) p.write(c++);
441 a._read(); // simulate bad forced read
442 }
443 if (!(p.writableEnded || ended) && c > 3) {
444 ended = true;
445 p.end();
446 // p.read();
447 setTimeout(read, 10);
448 return;
449 }
450 setImmediate(read);
451 }
452 });
453
454 it('prePush', (cb) => {

Callers 1

Calls 3

_readMethod · 0.80
writeMethod · 0.80
readMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…