commerce/lib/saleor/utils.ts
Michal Miszczyszyn a8e49ee3f4
Saleor
2023-05-02 00:32:20 +02:00

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);
}
}