Skip to content

Commit

Permalink
chore(console): updated jsdoc table (#14792)
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurvanl authored Oct 25, 2024
1 parent 0e4006e commit f21870a
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion packages/bun-types/globals.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1673,7 +1673,36 @@ declare global {
groupEnd(): void;
info(...data: any[]): void;
log(...data: any[]): void;
/** Does nothing currently */
/**
* Try to construct a table with the columns of the properties of `tabularData` (or use `properties`) and rows of `tabularData` and log it. Falls back to just
* logging the argument if it can't be parsed as tabular.
*
* ```js
* // These can't be parsed as tabular data
* console.table(Symbol());
* // Symbol()
*
* console.table(undefined);
* // undefined
*
* console.table([{ a: 1, b: 'Y' }, { a: 'Z', b: 2 }]);
* // ┌────┬─────┬─────┐
* // │ │ a │ b │
* // ├────┼─────┼─────┤
* // │ 0 │ 1 │ 'Y' │
* // │ 1 │ 'Z' │ 2 │
* // └────┴─────┴─────┘
*
* console.table([{ a: 1, b: 'Y' }, { a: 'Z', b: 2 }], ['a']);
* // ┌────┬─────┐
* // │ │ a │
* // ├────┼─────┤
* // │ 0 │ 1 │
* // │ 1 │ 'Z' │
* // └────┴─────┘
* ```
* @param properties Alternate properties for constructing the table.
*/
table(tabularData?: any, properties?: string[]): void;
/**
* Begin a timer to log with {@link console.timeEnd}
Expand Down

0 comments on commit f21870a

Please sign in to comment.