Skip to content

Commit

Permalink
node: fix util.format with node > 12
Browse files Browse the repository at this point in the history
  • Loading branch information
wdavidw committed Jul 26, 2019
1 parent 26938ef commit 8b9d3c0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/printf.js
Expand Up @@ -404,7 +404,15 @@ Formatter.prototype.formatDouble = function(token) {
Formatter.prototype.formatObject = function(token) {
// If no precision is specified, then reset it to null (infinite depth).
var precision = (token.period === '.') ? token.precision : null;
token.arg = util.inspect(token.arg, !token.alternative, precision, token.sign);
// Historically, inspect was called with 3 options
// token.arg = util.inspect(token.arg, !token.alternative, precision, token.sign);
// Now using an object but not sure colors make any sense here
token.arg = util.inspect(token.arg, {
showHidden: !token.alternative,
depth: precision,
colors: token.sign,
compact: true
});
};
Formatter.prototype.zeroPad = function(token, /*Int*/ length) {
length = (arguments.length == 2) ? length : token.precision;
Expand Down

0 comments on commit 8b9d3c0

Please sign in to comment.