[API reference](https://evolu.dev/docs/api-reference) › [@evolu/common](https://evolu.dev/docs/api-reference/common) › [Assert](https://evolu.dev/docs/api-reference/common/Assert) › assert

```ts
const assert: (condition: unknown, message: string) => asserts condition;
```

Defined in: [packages/common/src/Assert.ts:29](https://github.com/evoluhq/evolu/blob/e7144e2bbe9069362b62dec1b64a8aa922b8f1b0/packages/common/src/Assert.ts#L29)

Ensures a condition is true, throwing an error with the provided message if
not.

Prevents invalid states from propagating through the system by halting
execution when a condition fails, improving reliability and debuggability.

Do not use this instead of [Type](https://evolu.dev/docs/api-reference/common/Type/interfaces/Type). Assertions are intended for
conditions that are logically guaranteed but not statically known by
TypeScript, or for catching and signaling developer mistakes eagerly.

### Example

```ts
assert(true, "true is not true"); // no-op
assert(false, "true is not true"); // throws Error
```