11 lines
213 B
TypeScript
11 lines
213 B
TypeScript
export function must<T = any>(func: CallableFunction): T {
|
|
try {
|
|
return func();
|
|
} catch(e) {
|
|
console.log('error', e);
|
|
throw e;
|
|
}
|
|
}
|
|
|
|
export type Maybe<T> = T | null | undefined;
|