uft
    Preparing search index...

    Type Alias CompareFn<T>

    CompareFn: (item: T[number], toInsert: T[number]) => number

    Function used to determine where to insert. Follows the same logic as the Array.prototype.sort() compareFn parameter.

    Type Parameters

    • T extends unknown[]

    Type Declaration

      • (item: T[number], toInsert: T[number]): number
      • Parameters

        • item: T[number]

          An item currently in the array.

        • toInsert: T[number]

          The item to be inserted.

        Returns number

        • < 0 to insert before item, i.e [toInsert, item]
        • > 0 to insert after item, i.e [item, toInsert]
        • = 0 for equal elements