effect-io-ai

Package: effect
Module: Array

Array.isNonEmptyArray

Determine if an Array is non empty narrowing down the type to NonEmptyArray.

An Array is considered to be a NonEmptyArray if it contains at least one element.

Example

import { Array } from "effect"

console.log(Array.isNonEmptyArray([])) // false
console.log(Array.isNonEmptyArray([1, 2, 3])) // true

Signature

declare const isNonEmptyArray: <A>(self: Array<A>) => self is NonEmptyArray<A>

Source

Since v2.0.0