Files
core_ng/server/util/unwrap_any.ts
T
2023-08-05 15:34:26 +00:00

11 lines
283 B
TypeScript

import type { Nullable } from ".//Nullable";
import { NotNullExpected } from ".//NotNullExpected";
export function unwrap_any<T>(result: Nullable<unknown>): T {
if (result === null || result === undefined) {
throw new NotNullExpected();
}
return result as T;
}