Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

291 B
Raw Blame
export const createVisibleResultPositionMap = <T>(groups: T[][], offset = 0) => {
  const positions = new Map<T, number>();
  let position = offset;

  for (const group of groups) {
    for (const result of group) {
      positions.set(result, ++position);
    }
  }

  return positions;
};