(x: never, msg?: string)
| 11 | |
| 12 | // https://basarat.gitbook.io/typescript/type-system/discriminated-unions#throw-in-exhaustive-checks |
| 13 | export function assertNever(x: never, msg?: string): never { |
| 14 | if (msg != null) { |
| 15 | throw new Error(msg) |
| 16 | } |
| 17 | throw new Error( |
| 18 | `Expected 'never', but got an unexpected value: |
| 19 | ${JSON.stringify(x)}`, |
| 20 | ) |
| 21 | } |
| 22 | |
| 23 | export function undefinedMap<T, R>( |
| 24 | t: T | undefined, |
no outgoing calls
no test coverage detected