MCPcopy Index your code
hub / github.com/CommandCodeAI/BaseAI / printDiffTable

Function printDiffTable

packages/baseai/src/utils/memory/print-diff-table.ts:11–43  ·  view source on GitHub ↗
(localDocs: string[], prodDocs: string[])

Source from the content-addressed store, hash-verified

9 * @param prodDocs - The array of production documents.
10 */
11export function printDiffTable(localDocs: string[], prodDocs: string[]) {
12 const allItems = new Set([...localDocs, ...prodDocs]);
13 const tableData = Array.from(allItems).map(item => [
14 localDocs.includes(item) ? item : '',
15 prodDocs.includes(item) ? item : ''
16 ]);
17
18 const table = new Table({
19 head: [chalk.cyan('Local'), chalk.cyan('Prod')],
20 chars: {
21 top: '═',
22 'top-mid': '╤',
23 'top-left': '╔',
24 'top-right': '╗',
25 bottom: '═',
26 'bottom-mid': '╧',
27 'bottom-left': '╚',
28 'bottom-right': '╝',
29 left: '║',
30 'left-mid': '╟',
31 mid: '─',
32 'mid-mid': '┼',
33 right: '║',
34 'right-mid': '╢',
35 middle: '│'
36 }
37 });
38
39 tableData.forEach(row => table.push(row));
40
41 p.log.message(`Prod and local are out of sync.`);
42 p.log.message(`\n${table.toString()}`);
43}

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected