util: change %o depth default
Since the default for depth is changed to `Infinity` it is logical to change the %o default to the same as well. Using %o with `util.format` will now always print the whole object. PR-URL: https://github.com/nodejs/node/pull/17907 Refs: https://github.com/nodejs/node/issues/12693 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
This commit is contained in:
parent
b994b8eff6
commit
8f153092d8
@ -187,6 +187,9 @@ property take precedence over `--trace-deprecation` and
|
|||||||
<!-- YAML
|
<!-- YAML
|
||||||
added: v0.5.3
|
added: v0.5.3
|
||||||
changes:
|
changes:
|
||||||
|
- version: REPLACEME
|
||||||
|
pr-url: https://github.com/nodejs/node/pull/17907
|
||||||
|
description: The `%o` specifiers `depth` option is now set to Infinity.
|
||||||
- version: v8.4.0
|
- version: v8.4.0
|
||||||
pr-url: https://github.com/nodejs/node/pull/14558
|
pr-url: https://github.com/nodejs/node/pull/14558
|
||||||
description: The `%o` and `%O` specifiers are supported now.
|
description: The `%o` and `%O` specifiers are supported now.
|
||||||
@ -209,12 +212,11 @@ corresponding argument. Supported placeholders are:
|
|||||||
contains circular references.
|
contains circular references.
|
||||||
* `%o` - Object. A string representation of an object
|
* `%o` - Object. A string representation of an object
|
||||||
with generic JavaScript object formatting.
|
with generic JavaScript object formatting.
|
||||||
Similar to `util.inspect()` with options `{ showHidden: true, depth: 4, showProxy: true }`.
|
Similar to `util.inspect()` with options `{ showHidden: true, showProxy: true }`.
|
||||||
This will show the full object including non-enumerable symbols and properties.
|
This will show the full object including non-enumerable properties and proxies.
|
||||||
* `%O` - Object. A string representation of an object
|
* `%O` - Object. A string representation of an object with generic JavaScript
|
||||||
with generic JavaScript object formatting.
|
object formatting. Similar to `util.inspect()` without options. This will show
|
||||||
Similar to `util.inspect()` without options.
|
the full object not including non-enumerable properties and proxies.
|
||||||
This will show the full object not including non-enumerable symbols and properties.
|
|
||||||
* `%%` - single percent sign (`'%'`). This does not consume an argument.
|
* `%%` - single percent sign (`'%'`). This does not consume an argument.
|
||||||
|
|
||||||
If the placeholder does not have a corresponding argument, the placeholder is
|
If the placeholder does not have a corresponding argument, the placeholder is
|
||||||
|
@ -195,7 +195,7 @@ function format(f) {
|
|||||||
break;
|
break;
|
||||||
case 111: // 'o'
|
case 111: // 'o'
|
||||||
tempStr = inspect(arguments[a++],
|
tempStr = inspect(arguments[a++],
|
||||||
{ showHidden: true, depth: 4, showProxy: true });
|
{ showHidden: true, showProxy: true });
|
||||||
break;
|
break;
|
||||||
case 105: // 'i'
|
case 105: // 'i'
|
||||||
tempStr = `${parseInt(arguments[a++])}`;
|
tempStr = `${parseInt(arguments[a++])}`;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user