MCPcopy
hub / github.com/ValueCell-ai/ClawX / redactGatewayFrameForTrace

Function redactGatewayFrameForTrace

electron/gateway/ws-trace.ts:17–33  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

15}
16
17export function redactGatewayFrameForTrace(value: unknown): unknown {
18 if (Array.isArray(value)) {
19 return value.map((item) => redactGatewayFrameForTrace(item));
20 }
21 if (!value || typeof value !== 'object') {
22 return value;
23 }
24
25 const result: Record<string, unknown> = {};
26 for (const [key, item] of Object.entries(value as Record<string, unknown>)) {
27 const normalizedKey = key.toLowerCase();
28 result[key] = SECRET_KEYS.has(normalizedKey)
29 ? '[redacted]'
30 : redactGatewayFrameForTrace(item);
31 }
32 return result;
33}
34
35export function summarizeGatewayFrameForTrace(value: unknown): string {
36 if (!value || typeof value !== 'object') return typeof value;

Callers 5

rpcMethod · 0.90
handleMessageMethod · 0.90
sendConnectHandshakeFunction · 0.90
connectGatewaySocketFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected