by triyambakam · 3y ago · 0 comments
type NonEmptyArray = [unknown, ...unknown[]];
const nea: NonEmptyArray = [];
// ^^^ Type '[]' is not assignable to type 'NonEmptyArray'.
// Source has 0 element(s) but target requires 1. type NonEmptyArray<T> = [T, ...T[]];