3 ms·
This SO answer is pretty clever: https://stackoverflow.com/a/56006703 https://stackoverflow.com/a/56006703 type NonEmptyArray<T> = [T, ...T[]]; That is: A typ
by scrollaway 7y ago
This SO answer is pretty clever: https://stackoverflow.com/a/56006703 https://stackoverflow.com/a/56006703
type NonEmptyArray<T> = [T, ...T[]];
That is: A type of "NonEmptyArray" of T is an array of one element of type T, followed by any number of type-T elements.