Function compare

  • Namespace

    InternalUtils

    Helper function to compare two values based on the given sort order.

    Type Parameters

    • T

    Parameters

    • a: T

      The first value to compare.

    • b: T

      The second value to compare.

    • sortOrder: SortOrder = SortOrder.ASC

      The sorting order, either 'ASC' for ascending or 'DESC' for descending.

    Returns number

    -1 if 'a' should come before 'b', 1 if 'a' should come after 'b', or 0 if they are equal.

Generated using TypeDoc