assertGreaterOrEqual

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

function

function assertGreaterOrEqual<T>(actual: T, expected: T, msg?: string): void

Make an assertion that actual is greater than or equal to expected. If not then throw.

actual: T

The actual value to compare.

expected: T

The expected value to compare.

msg?: string

The optional message to display if the assertion fails.

Example: Usage

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

assertGreaterOrEqual(2, 1); // Doesn't throw
assertGreaterOrEqual(1, 1); // Doesn't throw
assertGreaterOrEqual(0, 1); // Throws

Source