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.

655 B
Raw Blame
// Why: polls re-parse rows into fresh objects, so lists and rows compare by value to skip renders.
export function areStructurallyEqual(a: unknown, b: unknown): boolean {
  if (Object.is(a, b)) {
    return true
  }
  if (
    !a ||
    !b ||
    typeof a !== 'object' ||
    typeof b !== 'object' ||
    Array.isArray(a) !== Array.isArray(b)
  ) {
    return false
  }
  const leftEntries = Object.entries(a)
  const rightEntries = new Map(Object.entries(b))
  return (
    leftEntries.length === rightEntries.size &&
    leftEntries.every(
      ([key, value]) => rightEntries.has(key) && areStructurallyEqual(value, rightEntries.get(key))
    )
  )
}