mirror of
https://github.com/denoland/deno.git
synced 2024-11-25 15:29:32 -05:00
fix(console): add assert function (#19635)
This commit is contained in:
parent
d82b5f3bec
commit
558eb9f132
1 changed files with 6 additions and 0 deletions
|
@ -147,6 +147,12 @@ function getNoColor() {
|
||||||
return noColor;
|
return noColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function assert(cond, msg = "Assertion failed.") {
|
||||||
|
if (!cond) {
|
||||||
|
throw new AssertionError(msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Don't use 'blue' not visible on cmd.exe
|
// Don't use 'blue' not visible on cmd.exe
|
||||||
const styles = {
|
const styles = {
|
||||||
special: "cyan",
|
special: "cyan",
|
||||||
|
|
Loading…
Reference in a new issue