Files
core/hwe/ts/util/unwrap.ts
T

10 lines
268 B
TypeScript

import { Nullable } from "@util/Nullable";
import { NotNullExpected } from "@util/NotNullExpected";
export function unwrap<T>(result: Nullable<T>): T {
if (result === null || result === undefined) {
throw new NotNullExpected();
}
return result;
}