MCPcopy Create free account
hub / github.com/denoland/std / decodeAsyncIterable

Function decodeAsyncIterable

xml/_decode.ts:19–28  ·  view source on GitHub ↗
(
  source: AsyncIterable<Uint8Array>,
)

Source from the content-addressed store, hash-verified

17 * @returns An async generator yielding decoded text chunks.
18 */
19export async function* decodeAsyncIterable(
20 source: AsyncIterable<Uint8Array>,
21): AsyncGenerator<string> {
22 const decoder = new TextDecoder();
23 for await (const chunk of source) {
24 yield decoder.decode(chunk, { stream: true });
25 }
26 const final = decoder.decode();
27 if (final) yield final;
28}

Callers 2

parseXmlRecordsFromBytesFunction · 0.90
parseXmlStreamFromBytesFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected