(chunks: ReadonlyArray<string>)
| 1953 | ) |
| 1954 | |
| 1955 | const textStream = (chunks: ReadonlyArray<string>): ReadableStream<Uint8Array> => { |
| 1956 | let index = 0 |
| 1957 | return new ReadableStream<Uint8Array>({ |
| 1958 | pull(controller) { |
| 1959 | if (index === chunks.length) { |
| 1960 | controller.close() |
| 1961 | } else { |
| 1962 | controller.enqueue(textEncoder.encode(chunks[index++]!)) |
| 1963 | } |
| 1964 | } |
| 1965 | }) |
| 1966 | } |
| 1967 | |
| 1968 | const byteStream = (chunks: ReadonlyArray<Uint8Array>): ReadableStream<Uint8Array> => { |
| 1969 | let index = 0 |
no outgoing calls
no test coverage detected