asserts.ts 193 B

1234567
  1. export function assertIsDefined<T>(value: T | null | undefined): T {
  2. if (value == null) {
  3. throw new Error(`Expected value to not be null but got ${typeof value}`);
  4. }
  5. return value;
  6. }