MCPcopy Create free account
hub / github.com/getsentry/sentry-javascript / pull

Function pull

packages/react-router/src/cloudflare/index.ts:18–37  ·  view source on GitHub ↗
(controller)

Source from the content-addressed store, hash-verified

16 const reader = body.getReader();
17 const stream = new ReadableStream({
18 async pull(controller) {
19 const { done, value } = await reader.read();
20
21 if (done) {
22 controller.close();
23 return;
24 }
25
26 const encoder = new TextEncoder();
27 const html = value instanceof Uint8Array ? new TextDecoder().decode(value) : String(value);
28
29 if (html.includes(headClosingTag)) {
30 const modifiedHtml = html.replace(headClosingTag, `${getTraceMetaTags()}${headClosingTag}`);
31
32 controller.enqueue(encoder.encode(modifiedHtml));
33 return;
34 }
35
36 controller.enqueue(encoder.encode(html));
37 },
38 });
39
40 return stream;

Callers

nothing calls this directly

Calls 7

encodeMethod · 0.95
getTraceMetaTagsFunction · 0.90
decodeMethod · 0.80
replaceMethod · 0.80
readMethod · 0.65
closeMethod · 0.65
enqueueMethod · 0.65

Tested by

no test coverage detected