import { isNullish } from "./isNullish"; import { MValue } from "./types"; export const throwOnNullish = (msg: string) => (t: MValue): T => { if (isNullish(t)) { throw new Error(msg); } return t; };