[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 NonEmptyArray<T>;
```

Defined in: [packages/common/src/Assert.ts:430](https://github.com/evoluhq/evolu/blob/037c390af081e9944d616ff298a729515c5c5ab7/packages/common/src/Assert.ts#L430)

Asserts that an array is non-empty.

Use this when an array is logically guaranteed to be non-empty but TypeScript
cannot prove it.

### Example

```ts
import {
  assertEqual,
  assertErr,
  assertNonEmptyArray,
  assertType,
  trySync,
  type NonEmptyArray,
} from "@evolu/common";

const values = [1, 2, 3];
assertNonEmptyArray(values);
assertType<NonEmptyArray<number>, typeof values>();
assertEqual(values[0], 1);
const result = trySync(() => assertNonEmptyArray([]));
assertErr(result);
```