MCPcopy Create free account
hub / github.com/cli-table/cli-table3 / cellsConflict

Function cellsConflict

src/layout-manager.js:51–65  ·  view source on GitHub ↗
(cell1, cell2)

Source from the content-addressed store, hash-verified

49 }
50
51 function cellsConflict(cell1, cell2) {
52 let yMin1 = cell1.y;
53 let yMax1 = cell1.y - 1 + (cell1.rowSpan || 1);
54 let yMin2 = cell2.y;
55 let yMax2 = cell2.y - 1 + (cell2.rowSpan || 1);
56 let yConflict = !(yMin1 > yMax2 || yMin2 > yMax1);
57
58 let xMin1 = cell1.x;
59 let xMax1 = cell1.x - 1 + (cell1.colSpan || 1);
60 let xMin2 = cell2.x;
61 let xMax2 = cell2.x - 1 + (cell2.colSpan || 1);
62 let xConflict = !(xMin1 > xMax2 || xMin2 > xMax1);
63
64 return yConflict && xConflict;
65 }
66
67 function conflictExists(rows, x, y) {
68 let i_max = Math.min(rows.length - 1, y);

Callers 1

conflictExistsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…