(node: Node | null)
| 20 | } |
| 21 | |
| 22 | export function findDiffLineNumber(node: Node | null): number | undefined { |
| 23 | const el = findElement(node) |
| 24 | if (!el) return |
| 25 | |
| 26 | const line = el.closest("[data-line], [data-alt-line]") |
| 27 | if (!(line instanceof HTMLElement)) return |
| 28 | |
| 29 | const primary = parseInt(line.dataset.line ?? "", 10) |
| 30 | if (!Number.isNaN(primary)) return primary |
| 31 | |
| 32 | const alt = parseInt(line.dataset.altLine ?? "", 10) |
| 33 | if (!Number.isNaN(alt)) return alt |
| 34 | } |
| 35 | |
| 36 | export function findCodeSelectionSide(node: Node | null): SelectedLineRange["side"] { |
| 37 | const el = findElement(node) |
nothing calls this directly
no test coverage detected