( source: Record<string, unknown>, key: string, )
| 54 | } |
| 55 | |
| 56 | export function readOptionalNumberArray( |
| 57 | source: Record<string, unknown>, |
| 58 | key: string, |
| 59 | ): number[] | undefined { |
| 60 | const value = source[key] |
| 61 | |
| 62 | if ( |
| 63 | !Array.isArray(value) |
| 64 | || value.some(item => typeof item !== 'number' || !Number.isFinite(item)) |
| 65 | ) { |
| 66 | return undefined |
| 67 | } |
| 68 | |
| 69 | return [...value] |
| 70 | } |
| 71 | |
| 72 | export function readEnum<T extends string>( |
| 73 | source: Record<string, unknown>, |
no outgoing calls
no test coverage detected