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

Method from

cbor/sequence_encoder_stream.ts:286–292  ·  view source on GitHub ↗

* Creates a CborSequenceEncoderStream instance from an iterable of * CborStreamInput chunks. * * @example Usage * ```ts no-assert * import { encodeBase64Url } from "@std/encoding"; * import { * CborArrayDecodedStream, * CborArrayEncoderStream, * CborB

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

Source from the content-addressed store, hash-verified

284 * @returns A {@link CborSequenceEncoderStream} instance of the encoded data.
285 */
286 static from(
287 asyncIterable: AsyncIterable<CborStreamInput> | Iterable<CborStreamInput>,
288 ): CborSequenceEncoderStream {
289 const encoder = new CborSequenceEncoderStream();
290 ReadableStream.from(asyncIterable).pipeTo(encoder.writable);
291 return encoder;
292 }
293
294 /**
295 * The {@link ReadableStream<Uint8Array>} associated with the instance, which

Callers 1

constructorMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected