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

Function readableStream

test-src/JsonStreamStringify.spec.ts:39–52  ·  view source on GitHub ↗
(...args)

Source from the content-addressed store, hash-verified

37}
38
39function readableStream(...args) {
40 const stream = new Readable({
41 objectMode: args.some(v => typeof v !== 'string'),
42 });
43 stream._read = () => {
44 if (!args.length) {
45 return stream.push(null);
46 }
47 const v = args.shift();
48 if (v instanceof Error) return stream.emit('error', v);
49 return stream.push(v);
50 };
51 return stream;
52}
53
54describe('JsonStreamStringify', function () {
55 this.timeout(10000);

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…