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

Method transform

encoding/unstable_base32_stream.ts:89–108  ·  view source on GitHub ↗
(chunk, controller)

Source from the content-addressed store, hash-verified

87 let remainder = 0;
88 super({
89 transform(chunk, controller) {
90 let [output, i] = detach(
91 chunk,
92 calcSizeBase32(remainder + chunk.length),
93 );
94 if (remainder) {
95 i -= remainder;
96 output.set(push.subarray(0, remainder), i);
97 }
98 remainder = (output.length - i) % 5;
99 if (remainder) push.set(output.subarray(-remainder));
100 const o = encode(
101 output.subarray(0, -remainder || undefined),
102 i,
103 0,
104 abc,
105 padding,
106 );
107 controller.enqueue(decode(output.subarray(0, o)));
108 },
109 flush(controller) {
110 if (remainder) {
111 const [output, i] = detach(

Callers

nothing calls this directly

Calls 5

detachFunction · 0.90
calcSizeBase32Function · 0.90
encodeFunction · 0.90
decodeFunction · 0.90
setMethod · 0.65

Tested by

no test coverage detected