Skip to content

assertGreaterThan

Assert that a numeric value is greater than the expected value, with type-narrowing.

import { assertGreaterThan } from "@kensio/smartass";
const elapsed: unknown = 120;
assertGreaterThan(elapsed, 0);
// elapsed is now narrowed to number | bigint

Source file: src/assert/greater-than/greater-than.assert.ts