Represents a non-empty array of elements of type T. Ensures that the array has at least one item.
T
const valid: NonEmptyArray<number> = [1]; // ✅const invalid: NonEmptyArray<number> = []; // ❌ Type error Copy
const valid: NonEmptyArray<number> = [1]; // ✅const invalid: NonEmptyArray<number> = []; // ❌ Type error
Represents a non-empty array of elements of type
T
. Ensures that the array has at least one item.