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

Function checkLayout

test/table-layout-test.js:363–372  ·  view source on GitHub ↗

* Provides a shorthand for validating a table of cells. * To pass, both arrays must have the same dimensions, and each cell in `actualRows` must * satisfy the shorthand assertion of the corresponding location in `expectedRows`. * * Available Expectations Can Be: * * * A `String`

(actualTable, expectedTable)

Source from the content-addressed store, hash-verified

361 */
362
363 function checkLayout(actualTable, expectedTable) {
364 expectedTable.forEach(function (expectedRow, y) {
365 expectedRow.forEach(function (expectedCell, x) {
366 if (expectedCell !== null) {
367 let actualCell = findCell(actualTable, x, y);
368 checkExpectation(actualCell, expectedCell, x, y, actualTable);
369 }
370 });
371 });
372 }
373
374 function findCell(table, x, y) {
375 for (let i = 0; i < table.length; i++) {

Callers 1

Calls 2

findCellFunction · 0.85
checkExpectationFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…