Skip to content

Commit ce3a5af

Browse files
BridgeARMylesBorins
authored andcommitted
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. Backport-PR-URL: #19230 PR-URL: #17576 Reviewed-By: Anna Henningsen <[email protected]>
1 parent fd4c05a commit ce3a5af

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/util.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -257,14 +257,14 @@ function debuglog(set) {
257257
}
258258

259259
/**
260-
* Echos the value of a value. Tries to print the value out
260+
* Echos the value of any input. Tries to print the value out
261261
* in the best way possible given the different types.
262262
*
263-
* @param {Object} obj The object to print out.
263+
* @param {any} value The value to print out.
264264
* @param {Object} opts Optional options object that alters the output.
265265
*/
266-
/* Legacy: obj, showHidden, depth, colors*/
267-
function inspect(obj, opts) {
266+
/* Legacy: value, showHidden, depth, colors*/
267+
function inspect(value, opts) {
268268
// Default options
269269
const ctx = {
270270
seen: [],
@@ -298,7 +298,7 @@ function inspect(obj, opts) {
298298
}
299299
if (ctx.colors) ctx.stylize = stylizeWithColor;
300300
if (ctx.maxArrayLength === null) ctx.maxArrayLength = Infinity;
301-
return formatValue(ctx, obj, ctx.depth);
301+
return formatValue(ctx, value, ctx.depth);
302302
}
303303
inspect.custom = customInspectSymbol;
304304

0 commit comments

Comments
 (0)