( ...groups: Array<Array<string> | undefined> )
| 57 | } |
| 58 | |
| 59 | export function collectSecretValues( |
| 60 | ...groups: Array<Array<string> | undefined> |
| 61 | ): string[] { |
| 62 | const values = new Set<string>(); |
| 63 | for (const group of groups) { |
| 64 | for (const value of group ?? []) { |
| 65 | if (value) values.add(value); |
| 66 | } |
| 67 | } |
| 68 | return [...values].sort((a, b) => b.length - a.length); |
| 69 | } |
| 70 | |
| 71 | export function redactSecrets<T>(value: T, secretValues: string[]): T { |
| 72 | if (secretValues.length === 0) return value; |
no test coverage detected