MCPcopy
hub / github.com/infinitered/reactotron / redactValue

Function redactValue

lib/reactotron-mcp/src/redaction.ts:260–277  ·  view source on GitHub ↗
(data: unknown, ctx: RedactionContext, currentPath: string)

Source from the content-addressed store, hash-verified

258}
259
260function redactValue(data: unknown, ctx: RedactionContext, currentPath: string): unknown {
261 if (data === null || data === undefined) return data
262
263 if (typeof data === "string") {
264 return redactStringValue(data, ctx)
265 }
266
267 if (typeof data !== "object") return data
268
269 if (Array.isArray(data)) {
270 if (!ctx.parsed.trackPaths) {
271 return data.map((item) => redactValue(item, ctx, ""))
272 }
273 return data.map((item, i) => redactValue(item, ctx, currentPath ? `${currentPath}.${i}` : String(i)))
274 }
275
276 return redactObject(data as Record<string, unknown>, ctx, currentPath)
277}
278
279function redactObject(
280 obj: Record<string, unknown>,

Callers 3

redactWithParsedFunction · 0.85
redactObjectFunction · 0.85
redactStringValueFunction · 0.85

Calls 3

redactStringValueFunction · 0.85
StringFunction · 0.85
redactObjectFunction · 0.85

Tested by

no test coverage detected