• Creates a Predicate function that checks if all elements of an Array are sorted according to a Comparator.

    Exmaple

    Check if array is sorted

    const isSortedByNumber = isSorted(numberComparator);
    const array = [1,2,2,3];
    const result = isSortedByNumber(array);
    console.log(result); // true

    Returns

    the Predicate

    Type Parameters

    • T

      the Array value type

    Parameters

    Returns Predicate<[ArrayLike<T>]>

Generated using TypeDoc