fail

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

function

function fail(msg?: string): never

Forcefully throws a failed assertion.

msg?: string

Optional message to include in the error.

Returns

Never returns, always throws.

Example: Usage

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

fail("Deliberately failed!"); // Throws

Source