diff options
author | Ruben Bridgewater <ruben@bridgewater.de> | 2018-12-12 17:14:41 +0100 |
---|---|---|
committer | Ruben Bridgewater <ruben@bridgewater.de> | 2018-12-19 16:31:11 +0100 |
commit | 0f58ae392b0f90a64dde5ca48c3937bf5d586214 (patch) | |
tree | 2a8a3f1eae7eccdbef85b567eb4a1421cf94891d /lib/util.js | |
parent | 728b155870b69a83b806d8bee67aeb0fd0a9b2dd (diff) | |
download | node-new-0f58ae392b0f90a64dde5ca48c3937bf5d586214.tar.gz |
util: `format()` now formats bigint and booleans
This is necessary to distinguish them from other data types.
PR-URL: https://github.com/nodejs/node/pull/25046
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Diffstat (limited to 'lib/util.js')
-rw-r--r-- | lib/util.js | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/lib/util.js b/lib/util.js index ef28427cd8..f48d93d124 100644 --- a/lib/util.js +++ b/lib/util.js @@ -174,17 +174,8 @@ function formatWithOptions(inspectOptions, ...args) { while (a < args.length) { const value = args[a]; - // TODO(BridgeAR): This should apply for all besides strings. Especially - // BigInt should be properly inspected. str += join; - if (typeof value !== 'string' && - typeof value !== 'boolean' && - // eslint-disable-next-line valid-typeof - typeof value !== 'bigint') { - str += inspect(value, inspectOptions); - } else { - str += value; - } + str += typeof value !== 'string' ? inspect(value, inspectOptions) : value; join = ' '; a++; } |