Skip to content

Instantly share code, notes, and snippets.

@devinrhode2
Created January 10, 2022 04:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save devinrhode2/9854856a4313768d200d8e2e66c34e45 to your computer and use it in GitHub Desktop.
Save devinrhode2/9854856a4313768d200d8e2e66c34e45 to your computer and use it in GitHub Desktop.
/** @type {(...args: any[]) => never} */
const fail = (...args) => {
console.error(...args)
throw new Error(args.join(''))
}
export const warn = (...args: unknown[]): void => {
console.warn(...args)
if (window.location.origin.startsWith('localhost:')) {
throw new Error('refusing to render locally with warnings')
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment