Select a contiguous diff-line range
Return the selectable line IDs in the inclusive contiguous interval between an anchor and focus within one diff side.Description
Requirements
Export selectDiffLineRange from src/App.js.
Return an empty selection when anchorId or focusId is not present.
Return an empty selection when endpoints belong to different old or new sides.
Include both endpoints and every selectable line between them.
Return IDs in document order regardless of which endpoint comes first.
Return an observably equivalent result for equivalent inputs without reading time, randomness, network, storage, or DOM globals.
Do not mutate input objects, arrays, nested records, or values retained in the returned result.
Reverse drag
Focus line L5 then anchor L2
L2 through L5 return in document order
Return an empty selection when anchorId or focusId is not present.
Split side
Anchor is old and focus is new
The selection is empty
Return an empty selection when endpoints belong to different old or new sides.
Constraints
Implement a pure synchronous function with no external side effectsTreat every input collection and nested record as read-onlyReturn JSON-compatible data except where the declared TypeScript API explicitly uses bigint
Hints
Hint 1
Start with the finds-both-endpoints behavior and make its observable result deterministic.
Hint 2
Model requires-same-side independently before combining it with the remaining states.
Hint 3
Verify the boundary described by normalizes-direction without changing caller-owned input.