/** * @since 1.0.0 */ import type { NonEmptyArray, NonEmptyReadonlyArray } from "@fp-ts/core/ReadonlyArray" /** @internal */ export function isNonEmpty(self: Array): self is NonEmptyArray export function isNonEmpty(self: ReadonlyArray): self is NonEmptyReadonlyArray export function isNonEmpty(self: ReadonlyArray): self is readonly [] { return self.length > 0 } /** @internal */ export const fromIterable = (collection: Iterable): Array => Array.isArray(collection) ? collection : Array.from(collection)