@metreeca/core - v0.13.0
    Preparing search index...

    Function present

    • Wraps a comparator to sort present values first, ahead of null and then undefined values.

      Null values are treated as greater than any other value, and undefined values as greater than null ones. All other values are ordered by comparator, so it can safely assume that neither of its arguments is ever null or undefined.

      Type Parameters

      • V

        The type of values to compare (may include null/undefined)

      Parameters

      • comparator: Comparator<NonNullable<V>>

        Comparator for non-nullish values

      Returns Comparator<V>

      A comparator placing null and then undefined values last