1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-26 09:10:40 -05:00

fix(console): add assert function (#19635)

This commit is contained in:
Leo Kettmeir 2023-06-28 17:29:16 +02:00 committed by GitHub
parent d82b5f3bec
commit 558eb9f132
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -147,6 +147,12 @@ function getNoColor() {
return noColor;
}
function assert(cond, msg = "Assertion failed.") {
if (!cond) {
throw new AssertionError(msg);
}
}
// Don't use 'blue' not visible on cmd.exe
const styles = {
special: "cyan",