MCPcopy Create free account
hub / github.com/pollinations/pollinations / transform

Function transform

gen.pollinations.ai/src/utils/text-cache.ts:221–228  ·  view source on GitHub ↗
(chunk, controller)

Source from the content-addressed store, hash-verified

219
220 return new TransformStream({
221 transform(chunk, controller) {
222 // Save a copy of the chunk for caching later
223 chunks.push(chunk.slice());
224 totalSize += chunk.byteLength;
225
226 // Pass the chunk through unchanged to the client
227 controller.enqueue(chunk);
228 },
229 flush(_controller) {
230 // This runs when the stream is complete
231 log?.debug(

Calls 3

pushMethod · 0.80
sliceMethod · 0.80
enqueueMethod · 0.80

Tested by

no test coverage detected