API reference@evolu/commonAssert › assertTrue

const assertTrue: (value: unknown) => asserts value is true;

Defined in: packages/common/src/Assert.ts:98

Asserts that a value is exactly true and narrows it to true.

Unlike assert, this checks an exact boolean value instead of truthiness and does not require a custom message.

Example

import { assertTrue, assertType } from "@evolu/common";

const value: unknown = true;
assertTrue(value);
assertType<true, typeof value>();