MCPcopy
hub / github.com/axios/axios / makeReadableStream

Function makeReadableStream

tests/setup/server.js:187–199  ·  view source on GitHub ↗
(chunk = 'chunk', n = 10, timeout = 100)

Source from the content-addressed store, hash-verified

185};
186
187export const makeReadableStream = (chunk = 'chunk', n = 10, timeout = 100) => {
188 return new ReadableStream(
189 {
190 async pull(controller) {
191 await setTimeoutAsync(timeout);
192 n-- ? controller.enqueue(chunk) : controller.close();
193 },
194 },
195 {
196 highWaterMark: 1,
197 }
198 );
199};
200
201export const makeEchoStream = (echo) =>
202 new WritableStream({

Callers 1

fetch.test.jsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected