MCPcopy Create free account
hub / github.com/CommandCodeAI/BaseAI / iterLines

Method iterLines

packages/core/src/common/stream.ts:104–117  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

102 let consumed = false;
103
104 async function* iterLines(): AsyncGenerator<string, void, unknown> {
105 const lineDecoder = new LineDecoder();
106
107 const iter = readableStreamAsyncIterable<Bytes>(readableStream);
108 for await (const chunk of iter) {
109 for (const line of lineDecoder.decode(chunk)) {
110 yield line;
111 }
112 }
113
114 for (const line of lineDecoder.flush()) {
115 yield line;
116 }
117 }
118
119 async function* iterator(): AsyncIterator<Item, any, undefined> {
120 if (consumed) {

Callers

nothing calls this directly

Calls 3

decodeMethod · 0.95
flushMethod · 0.95

Tested by

no test coverage detected