diff options
author | Rich Trott <rtrott@gmail.com> | 2018-04-25 22:47:56 -0700 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2018-04-27 23:07:35 -0700 |
commit | 99d56a4749e7b167b4f312a4fbcc754b7a3a8894 (patch) | |
tree | eef2e2775b61e9a88f443c6f5ea1408dff968879 /lib/console.js | |
parent | 65d97c96aa59517f90c34bf5a6b962e1b5e42316 (diff) | |
download | node-new-99d56a4749e7b167b4f312a4fbcc754b7a3a8894.tar.gz |
console: fix console.table() display edge case
If the properties are not specified in `console.table()`, then we should
make a best effort to determine them rather than put all values into a
"Values" column.
PR-URL: https://github.com/nodejs/node/pull/20323
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'lib/console.js')
-rw-r--r-- | lib/console.js | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/console.js b/lib/console.js index 39bcf701bf..a0158ec664 100644 --- a/lib/console.js +++ b/lib/console.js @@ -363,9 +363,7 @@ Console.prototype.table = function(tabularData, properties) { tabularData = previewSetIterator(tabularData); const setlike = setIter || isSet(tabularData); - if (setlike || - (properties === undefined && - (isArray(tabularData) || isTypedArray(tabularData)))) { + if (setlike) { const values = []; let length = 0; for (const v of tabularData) { |