mirror of
https://github.com/vercel/commerce.git
synced 2025-05-17 15:06:59 +00:00
6 lines
172 B
TypeScript
6 lines
172 B
TypeScript
export function invariant<T>(val: T | null | undefined, message: string): asserts val is T {
|
|
if (val === undefined || val === null) {
|
|
throw new Error(message);
|
|
}
|
|
}
|