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

Method from

cbor/text_encoder_stream.ts:99–105  ·  view source on GitHub ↗

* 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>,
  )

Source from the content-addressed store, hash-verified

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

Callers 1

constructorMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected