assertFalse

import { assertFalse } from "jsr:@ende/assert";

function

function assertFalse(expr: unknown, msg: string = ): asserts expr is Falsy

Make an assertion, an error will be thrown if expr has a truthy value.

expr: unknown

The expression to test.

msg: string =

The optional message to display if the assertion fails.

Example: Usage

import { assertFalse } from "@ende/assert";

assertFalse(false); // Doesn't throw
assertFalse(true); // Throws

Source