MCPcopy
hub / github.com/exceljs/exceljs / checkTable

Function checkTable

spec/unit/doc/worksheet-table.spec.js:52–77  ·  view source on GitHub ↗
(ref, ws, testValues)

Source from the content-addressed store, hash-verified

50}
51
52function checkTable(ref, ws, testValues) {
53 const a = colCache.decodeAddress(ref);
54
55 for (let i = -1; i <= testValues.length + 1; i++) {
56 const vRow = testValues[i];
57 const nRow = i + a.row;
58 const row = nRow >= 1 && ws.getRow(nRow);
59 if (!row) continue;
60 for (let j = -1; j <= testValues[0].length + 1; j++) {
61 const value = (vRow && vRow[j]) || null;
62 const nCol = j + a.col;
63 const cellValue = nCol >= 1 && row.getCell(nCol).value;
64 if (!cellValue) continue;
65
66 if (value instanceof Date) {
67 expect(cellValue).to.equalDate(value);
68 } else if (value === null) {
69 expect(cellValue).to.be.null();
70 } else if (typeof value === 'object') {
71 expect(cellValue).to.deep.equal(value);
72 } else {
73 expect(cellValue).to.equal(value);
74 }
75 }
76 }
77}
78
79describe('Worksheet', () => {
80 describe('Table', () => {

Callers 1

Calls 2

getRowMethod · 0.65
getCellMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…