export interface NonEmptyArray extends Array { 0: A; } export const create = (a: A, ...othersA: Array) => [a, ...othersA] as NonEmptyArray; export const isNonEmptyArray = (arr: Array): arr is NonEmptyArray => arr.length > 0;