Function resolveByPredicate

  • Resolves the first value accepted by the supplied predicate.

    Values are evaluated in the order provided. The first value accepted by the predicate is returned. If no values are accepted, undefined is returned.

    Type Parameters

    • T

    Parameters

    • predicate: TypePredicate<T>

      Predicate used to evaluate each value.

    • ...values: unknown[]

      Values to evaluate in order.

    Returns T

    The first value accepted by the predicate; otherwise undefined.