Skip to content

armgit / orca

Public Imported from GitHub
0

Orca is the place for working with a fleet of agents (e.g. Grok Bot, Claude Code). Run any coding agent with your own subscription. Available on desktop, mobile and remote runtime.

454 B
Raw Blame
/** Sorts in place; invalid dates retain the native comparator's stable tie behavior. */
export function sortByUpdatedAtDescending<T extends { updatedAt: string }>(items: T[]): T[] {
  if (items.length < 2) {
    return items
  }
  const timestamps = new Map<T, number>()
  for (const item of items) {
    timestamps.set(item, new Date(item.updatedAt).getTime())
  }
  return items.sort((left, right) => timestamps.get(right)! - timestamps.get(left)!)
}