[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) › assertNonEmptyArray

```ts
const assertNonEmptyArray: <T>(
  arr: T[],
  message?: string,
) => asserts arr is [T, ...T[]];
```

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

Asserts that an array is non-empty.

Ensures the provided array has at least one element, helping TypeScript infer
the array as non-empty when this is logically guaranteed but not statically
known.

### Example

```ts
assertNonEmptyArray([1, 2, 3]); // no-op
assertNonEmptyArray([]); // throws Error
```