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:
parent
d82b5f3bec
commit
558eb9f132
1 changed files with 6 additions and 0 deletions
|
@ -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",
|
||||
|
|
Loading…
Reference in a new issue