MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / scrubbedBatch

Function scrubbedBatch

apps/cloud/src/observability/browser-traces.ts:27–35  ·  view source on GitHub ↗
(body: string)

Source from the content-addressed store, hash-verified

25/** The batch re-serialized with every URL scrubbed, or `undefined` when it is
26 * not valid JSON (or too deep to scrub) and must be refused. */
27const scrubbedBatch = (body: string): string | undefined => {
28 // oxlint-disable-next-line executor/no-try-catch-or-throw -- boundary: JSON.parse throws on malformed input; the refusal path (400) is the handled outcome
29 try {
30 // oxlint-disable-next-line executor/no-json-parse -- boundary: the batch is deliberately unknown-shaped (the scrub walks arbitrary JSON); there is no schema to decode into
31 return JSON.stringify(redactOtlpTraceExport(JSON.parse(body)));
32 } catch {
33 return undefined;
34 }
35};
36
37export const browserTracesResponse = (
38 request: Request,

Callers 1

browserTracesResponseFunction · 0.85

Calls 1

redactOtlpTraceExportFunction · 0.90

Tested by

no test coverage detected