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

Method from

cbor/byte_encoder_stream.ts:102–108  ·  view source on GitHub ↗

* Creates a CborByteEncoderStream instance from an iterable of * Uint8Array chunks. * * @example Usage * ```ts * import { assert, assertEquals } from "@std/assert"; * import { concat } from "@std/bytes"; * import { * CborByteDecodedStream, * CborByteEnc

(
    asyncIterable: AsyncIterable<Uint8Array> | Iterable<Uint8Array>,
  )

Source from the content-addressed store, hash-verified

100 * @returns A {@link CborByteEncoderStream} instance of the encoded data.
101 */
102 static from(
103 asyncIterable: AsyncIterable<Uint8Array> | Iterable<Uint8Array>,
104 ): CborByteEncoderStream {
105 const encoder = new CborByteEncoderStream();
106 ReadableStream.from(asyncIterable).pipeTo(encoder.writable);
107 return encoder;
108 }
109
110 /**
111 * The {@link ReadableStream<Uint8Array>} associated with the instance, which

Callers 1

constructorMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected