(option: string, algorithms?: string[])
| 1 | export function validateAlgorithms(option: string, algorithms?: string[]) { |
| 2 | if ( |
| 3 | algorithms !== undefined && |
| 4 | (!Array.isArray(algorithms) || algorithms.some((s) => typeof s !== 'string')) |
| 5 | ) { |
| 6 | throw new TypeError(`"${option}" option must be an array of strings`) |
| 7 | } |
| 8 | |
| 9 | if (!algorithms) { |
| 10 | return undefined |
| 11 | } |
| 12 | |
| 13 | return new Set(algorithms) |
| 14 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…