MCPcopy Index your code
hub / github.com/codeaashu/claude-code / diff

Function diff

src/ink/screen.ts:1126–1140  ·  view source on GitHub ↗
(
  prev: Screen,
  next: Screen,
)

Source from the content-addressed store, hash-verified

1124 * Production code should use diffEach() to avoid allocations.
1125 */
1126export function diff(
1127 prev: Screen,
1128 next: Screen,
1129): [point: Point, removed: Cell | undefined, added: Cell | undefined][] {
1130 const output: [Point, Cell | undefined, Cell | undefined][] = []
1131 diffEach(prev, next, (x, y, removed, added) => {
1132 // Copy cells since diffEach reuses the objects
1133 output.push([
1134 { x, y },
1135 removed ? { ...removed } : undefined,
1136 added ? { ...added } : undefined,
1137 ])
1138 })
1139 return output
1140}
1141
1142type DiffCallback = (
1143 x: number,

Callers

nothing calls this directly

Calls 2

diffEachFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected