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

Method constructor

cbor/map_encoder_stream.ts:48–64  ·  view source on GitHub ↗

* Constructs a new instance.

()

Source from the content-addressed store, hash-verified

46 * Constructs a new instance.
47 */
48 constructor() {
49 const { readable, writable } = new TransformStream<
50 CborMapStreamInput,
51 CborMapStreamInput
52 >();
53 this.#readable = toByteStream(ReadableStream.from(async function* () {
54 yield new Uint8Array([0b101_11111]);
55 for await (const [k, v] of readable) {
56 yield encodeCbor(k);
57 for await (const x of CborSequenceEncoderStream.from([v]).readable) {
58 yield x;
59 }
60 }
61 yield new Uint8Array([0b111_11111]);
62 }()));
63 this.#writable = writable;
64 }
65
66 /**
67 * Creates a {@link CborMapEncoderStream} instance from an iterable of

Callers

nothing calls this directly

Calls 3

encodeCborFunction · 0.90
toByteStreamFunction · 0.85
fromMethod · 0.45

Tested by

no test coverage detected