API reference@evolu/common › Assert

Runtime assertions for invariants and value checks.

Functions

FunctionDescription
assertEqualAsserts that two Data values are equal according to eqData.
assertErrAsserts that a Result is an Err, optionally compares its error, and narrows the Result.
assertNotDisposedGuards synchronous methods on objects that may be called after disposal.
assertOkAsserts that a Result is an Ok, optionally compares its value, and narrows the Result.

Variables

VariableDescription
assertEnsures a condition is true, throwing an error with the provided message if not.
assertFalseAsserts that a value is exactly false and narrows it to false.
assertNonEmptyArrayAsserts that an array is non-empty.
assertNonEmptyReadonlyArrayAsserts that a readonly array is non-empty.
assertNonNullableAsserts that a value is non-nullable.
assertNotNullAsserts that a value is not null while preserving undefined.
assertNotUndefinedAsserts that a value is not undefined while preserving null.
assertSameAsserts that two values are the same according to eqStrict.
assertTrueAsserts that a value is exactly true and narrows it to true.