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

    Function defined

    • Wraps a comparator to handle null and undefined values.

      Null and undefined values are treated as greater than any other value and equal to each other. Non-nullish values are compared using the provided comparator.

      Type Parameters

      • V

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

      Parameters

      • comparator: (a: NonNullable<V>, b: NonNullable<V>) => number

        Comparator for non-nullish values

      Returns (a: V, b: V) => number

      A comparator that handles null and undefined values by placing them last