( query: T | null | undefined, )
| 18 | SENSITIVE_QUERY_PARAMS.some((param) => typeof query[param] !== 'undefined'); |
| 19 | |
| 20 | export const redactSensitiveQueryParams = <T extends Record<string, unknown>>( |
| 21 | query: T | null | undefined, |
| 22 | ): T => { |
| 23 | if (!query || typeof query !== 'object') { |
| 24 | return {} as T; |
| 25 | } |
| 26 | |
| 27 | return Object.keys(query).reduce( |
| 28 | (acc, key) => |
| 29 | (SENSITIVE_QUERY_PARAMS as readonly string[]).includes(key) |
| 30 | ? { ...acc, [key]: REDACTED_VALUE } |
| 31 | : acc, |
| 32 | query, |
| 33 | ); |
| 34 | }; |
no outgoing calls
no test coverage detected