docs: function sortRankedItems(a, b) {
    const aFirst = -1
    const bFirst = 1
    const {rank: aRank, index: aIndex, keyIndex: aKeyIndex} = a
    const {rank: bRank, index: bIndex, keyIndex: bKeyIndex} = b
    const same = aRank === bRank
    if (same) {
      if (aKeyIndex === bKeyIndex) {
        return aIndex < bIndex ? aFirst : bFirst
      } else {
        return aKeyIndex < bKeyIndex ? aFirst : bFirst
      }
    } else {
      return aRank > bRank ? aFirst : bFirst
    }
  }