Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
util: rename util.inspect argument
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.
  • Loading branch information
BridgeAR committed Dec 10, 2017
commit ecf019e8e7bca7495cf6b262b81989d8cf5d7780
10 changes: 5 additions & 5 deletions lib/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,14 +259,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: [],
Expand Down Expand Up @@ -301,7 +301,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;

Expand Down