7 lines
136 B
TypeScript
7 lines
136 B
TypeScript
|
export function unreachable(
|
||
|
value: never,
|
||
|
message = `No such case in exhaustive switch: ${value}`
|
||
|
) {
|
||
|
throw new Error(message)
|
||
|
}
|