next.js/test/e2e/app-dir/instant-validation-build/client-assertion-error.ts
client-assertion-error.ts16 lines329 B
class AssertionError extends Error {
  constructor(message: string, opts?: ErrorOptions) {
    super(message, opts)
    this.name = 'AssertionError'
  }
}

export function assert(
  result: boolean,
  message?: string
): asserts result is true {
  if (!result) {
    throw new AssertionError(message ?? 'Assertion failed')
  }
}
Quest for Codev2.0.0
/
SIGN IN