diff --git a/lib/util.js b/lib/util.js index cd6321cfe5270e..bb805a082b27d6 100644 --- a/lib/util.js +++ b/lib/util.js @@ -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;