(localDocs: string[], prodDocs: string[])
| 9 | * @param prodDocs - The array of production documents. |
| 10 | */ |
| 11 | export 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 | } |
no outgoing calls
no test coverage detected