Skip to content

Commit

Permalink
util: rename util.inspect argument
Browse files Browse the repository at this point in the history
util.inspect can actually receive any property and the description
was wrong so far. This fixes it by renaming the argument to
value and also updating the description.

Backport-PR-URL: #19230
PR-URL: #17576
Reviewed-By: Anna Henningsen <anna@addaleax.net>
  • Loading branch information
BridgeAR authored and MylesBorins committed Mar 20, 2018

Verified

This commit was signed with the committer’s verified signature.
targos Michaël Zasso
1 parent fd4c05a commit ce3a5af
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/util.js
Original file line number Diff line number Diff line change
@@ -257,14 +257,14 @@ function debuglog(set) {
}

/**
* Echos the value of a value. Tries to print the value out
* Echos the value of any input. Tries to print the value out
* in the best way possible given the different types.
*
* @param {Object} obj The object to print out.
* @param {any} value The value to print out.
* @param {Object} opts Optional options object that alters the output.
*/
/* Legacy: obj, showHidden, depth, colors*/
function inspect(obj, opts) {
/* Legacy: value, showHidden, depth, colors*/
function inspect(value, opts) {
// Default options
const ctx = {
seen: [],
@@ -298,7 +298,7 @@ function inspect(obj, opts) {
}
if (ctx.colors) ctx.stylize = stylizeWithColor;
if (ctx.maxArrayLength === null) ctx.maxArrayLength = Infinity;
return formatValue(ctx, obj, ctx.depth);
return formatValue(ctx, value, ctx.depth);
}
inspect.custom = customInspectSymbol;

0 comments on commit ce3a5af

Please sign in to comment.