vtils

Home > types > NonEmptyArray

NonEmptyArray type

非空数组类型。

Signature:

export declare type NonEmptyArray<T> = [T, ...T[]];

Example

type X = NonEmptyArray<number>
const x: X = [] // => error