NonEmptyArray
A type representing an array that guarantees at least 1 element. A type that represents a non-empty array.
Interface
typescript
type NonEmptyArray<T> = [T, ...T[]];
Usage
typescript
import { NonEmptyArray } from '@modern-kit/types';
const valid: NonEmptyArray<number> = [1, 2, 3];
const invalid: NonEmptyArray<number> = []; // Error