Created
January 10, 2022 04:00
-
-
Save devinrhode2/9854856a4313768d200d8e2e66c34e45 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** @type {(...args: any[]) => never} */ | |
const fail = (...args) => { | |
console.error(...args) | |
throw new Error(args.join('')) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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