* Creates a CborTextEncoderStream instance from an iterable of * string chunks. * * @example Usage * ```ts * import { assert, assertEquals } from "@std/assert"; * import { * CborSequenceDecoderStream, * CborTextDecodedStream, * CborTextEncoderStream,
(
asyncIterable: AsyncIterable<string> | Iterable<string>,
)
| 97 | * @returns A {@link CborTextEncoderStream} instance of the encoded data. |
| 98 | */ |
| 99 | static from( |
| 100 | asyncIterable: AsyncIterable<string> | Iterable<string>, |
| 101 | ): CborTextEncoderStream { |
| 102 | const encoder = new CborTextEncoderStream(); |
| 103 | ReadableStream.from(asyncIterable).pipeTo(encoder.writable); |
| 104 | return encoder; |
| 105 | } |
| 106 | |
| 107 | /** |
| 108 | * The {@link ReadableStream<Uint8Array>} associated with the instance, which |