js2ts: util.ts 분리

This commit is contained in:
2021-08-21 20:45:10 +09:00
parent edbe8e3561
commit f23ebcdc2d
16 changed files with 56 additions and 86 deletions
+9
View File
@@ -0,0 +1,9 @@
import { Nullable } from "./Nullable";
import { NotNullExpected } from "./NotNullExpected";
export function unwrap<T>(result: Nullable<T>): T {
if (result === null || result === undefined) {
throw new NotNullExpected();
}
return result;
}