UNPKG

852 BTypeScriptView Raw
1export interface TableDiffOptions {
2 /**
3 * @default false
4 */
5 logEmpty?: boolean;
6 /**
7 * @default undefined
8 *
9 * If set - values of each field will be stringified and limited to maxFieldLen.
10 */
11 maxFieldLen?: number;
12 /**
13 * Title of the A column
14 *
15 * @default `a`
16 */
17 aTitle?: string;
18 /**
19 * Title of the B column
20 *
21 * @default `b`
22 */
23 bTitle?: string;
24}
25/**
26 * Compares 2 objects, logs their differences via `console.table`.
27 *
28 * If `logEmpty` is set will explicitly log that fact, otherwise will log nothing.
29 *
30 * Function is located in nodejs-lib (not js-lib), because it's planned to improve in the future and add e.g colors (via chalk).
31 */
32export declare function tableDiff(a: Record<string, any>, b: Record<string, any>, opt?: TableDiffOptions): void;