API reference › @evolu/common › Assert
Runtime assertions for invariants and value checks.
Functions
| Function | Description |
|---|---|
| assertEqual | Asserts that two Data values are equal according to eqData. |
| assertErr | Asserts that a Result is an Err, optionally compares its error, and narrows the Result. |
| assertNotDisposed | Guards synchronous methods on objects that may be called after disposal. |
| assertOk | Asserts that a Result is an Ok, optionally compares its value, and narrows the Result. |
Variables
| Variable | Description |
|---|---|
| assert | Ensures a condition is true, throwing an error with the provided message if not. |
| assertFalse | Asserts that a value is exactly false and narrows it to false. |
| assertNonEmptyArray | Asserts that an array is non-empty. |
| assertNonEmptyReadonlyArray | Asserts that a readonly array is non-empty. |
| assertNonNullable | Asserts that a value is non-nullable. |
| assertNotNull | Asserts that a value is not null while preserving undefined. |
| assertNotUndefined | Asserts that a value is not undefined while preserving null. |
| assertSame | Asserts that two values are the same according to eqStrict. |
| assertTrue | Asserts that a value is exactly true and narrows it to true. |