(value: unknown)
| 2061 | } |
| 2062 | |
| 2063 | function redactDeep(value: unknown): unknown { |
| 2064 | if (Array.isArray(value)) return value.map(redactDeep); |
| 2065 | if (typeof value !== "object" || value === null) return value; |
| 2066 | const out: Record<string, unknown> = {}; |
| 2067 | for (const [key, nested] of Object.entries(value)) { |
| 2068 | out[key] = /token|secret|password|api[_-]?key|authorization/i.test(key) |
| 2069 | ? "[redacted]" |
| 2070 | : redactDeep(nested); |
| 2071 | } |
| 2072 | return out; |
| 2073 | } |
| 2074 | |
| 2075 | function summarizePayloadValue(value: unknown): unknown { |
| 2076 | const raw = JSON.stringify(value) ?? String(value); |
no outgoing calls
no test coverage detected