assertGreater

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

function

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

Make an assertion that actual is greater than 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 { assertGreater } from "@ende/assert";

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

Source