(x: T | undefined | null, message?: string, ...extra_info: any[])
| 116 | } |
| 117 | |
| 118 | export function unwrap<T>(x: T | undefined | null, message?: string, ...extra_info: any[]): T { |
| 119 | if (x === undefined || x === null) { |
| 120 | fail('Unwrap failed', message, extra_info); |
| 121 | } |
| 122 | return x; |
| 123 | } |
| 124 | |
| 125 | // Take a type value that is maybe a string and ensure it is |
| 126 | // T is syntax sugar for unwrapping to a string union |
no test coverage detected