import { array } from "https://deno.land/x/fun@v2.0.0/mod.ts";
const { isNonEmpty } = array;
A Refinement<ReadonlyArray, NonEmptyArray>, returning true if called with an array that has at least one item.
Examples
Example 1
Example 1
import * as A from "./array.ts";
const arr1 = [1]
const arr2 = A.init<number>();
const result1 = A.isNonEmpty(arr1);
// true and arr1 has type NonEmptyArray<number>
const result2 = A.isNonEmpty(arr2);
// false
Parameters
a: ReadonlyArray<A>
Returns
a is NonEmptyArray<A>