vis-util
    Preparing search index...

    Function binarySearchCustom

    This function does a binary search for a visible item in a sorted list. If we find a visible item, the code that uses this function will then iterate in both directions over this sorted list to find all visible items.

    Items ordered by start.

    1 is lower, 0 is equal, 1 is higher.

    Property name on an item (That is item[field]).

    Second property name on an item (That is item[field][field2]).

    Index of the found item or -1 if nothing was found.

    • Type Parameters

      • O extends object
      • K1 extends string | number | symbol
      • K2 extends string | number | symbol

      Parameters

      • orderedItems: O[]
      • comparator: (v: O[K1][K2]) => -1 | 0 | 1
      • field: K1
      • field2: K2

      Returns number

    • Type Parameters

      • O extends object
      • K1 extends string | number | symbol

      Parameters

      • orderedItems: O[]
      • comparator: (v: O[K1]) => -1 | 0 | 1
      • field: K1

      Returns number