Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "array/array-has-elements"

Index

Functions

Functions

arrayHasElements

  • arrayHasElements<T>(array: ReadonlyArray<T>): array is NonEmptyArray<T>
  • Checks if an array has at least 1 item, and types it as such.

    Type parameters

    • T

    Parameters

    • array: ReadonlyArray<T>

      The array to check if it has at least 1 element.

    Returns array is NonEmptyArray<T>

    True if not empty, otherwise false when empty.

Generated using TypeDoc