(value: unknown)
| 15 | } |
| 16 | |
| 17 | export 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 | |
| 35 | export function summarizeGatewayFrameForTrace(value: unknown): string { |
| 36 | if (!value || typeof value !== 'object') return typeof value; |
no outgoing calls
no test coverage detected