MCPcopy Create free account
hub / github.com/Snapchat/Valdi / pipeEachLine

Function pipeEachLine

npm_modules/cli/test/helpers/StreamHelpers.ts:15–21  ·  view source on GitHub ↗
(source: AsyncGenerator<Buffer | string>)

Source from the content-addressed store, hash-verified

13}
14
15export async function* pipeEachLine(source: AsyncGenerator<Buffer | string>): AsyncGenerator<Buffer | string> {
16 for await (const chunk of source) {
17 for (const line of eachLine(chunk)) {
18 yield line;
19 }
20 }
21}
22
23/**
24 * Reads the input of source and calls `fn` for each line as a side-effect.

Callers 1

onEachLineFunction · 0.85

Calls 1

eachLineFunction · 0.70

Tested by

no test coverage detected