UNPKG

883 BTypeScriptView Raw
1import { AnyObject } from '@naturalcycles/js-lib';
2export interface TableDiffOptions {
3 /**
4 * @default false
5 */
6 logEmpty?: boolean;
7 /**
8 * @default undefined
9 *
10 * If set - values of each field will be stringified and limited to maxFieldLen.
11 */
12 maxFieldLen?: number;
13 /**
14 * Title of the A column
15 *
16 * @default `a`
17 */
18 aTitle?: string;
19 /**
20 * Title of the B column
21 *
22 * @default `b`
23 */
24 bTitle?: string;
25}
26/**
27 * Compares 2 objects, logs their differences via `console.table`.
28 *
29 * If `logEmpty` is set will explicitly log that fact, otherwise will log nothing.
30 *
31 * 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).
32 */
33export declare function tableDiff(a: AnyObject, b: AnyObject, opt?: TableDiffOptions): void;