Skip to content
Closed
Changes from all commits
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
9 changes: 9 additions & 0 deletions doc/api/util.md
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,9 @@ stream.write('With ES6');
<!-- YAML
added: v0.3.0
changes:
- version: REPLACEME
pr-rul: https://github.com/nodejs/node/pull/22753

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: rul

description: Deprecated legacy signature.
- version: v10.6.0
pr-url: https://github.com/nodejs/node/pull/20725
description: Inspecting linked lists and similar objects is now possible
Expand All @@ -384,6 +387,9 @@ changes:
- version: v6.1.0
pr-url: https://github.com/nodejs/node/pull/6465
description: The `showProxy` option is supported now.
- version: v0.9.3
pr-url: https://github.com/nodejs/node-v0.x-archive/issues/4085
description: Take an "options" object as second argument
-->

* `object` {any} Any JavaScript primitive or `Object`.
Expand Down Expand Up @@ -424,6 +430,9 @@ changes:
example below. **Default:** `true`.
* Returns: {string} The representation of passed object

Deprecation notice: The legacy function signature that was changed in v0.9.3

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: remove Deprecation notice:.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest simplifying this greatly:

The legacy function signature `util.inspect(object, [showHidden], [depth], [colors])` is deprecated.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One problem with this is that it can be interpreted as saying that util.inspect(object) is deprecated but it is not. Can we indicate that the showHidden, depth, and colors arguments are deprecated instead of pointing to the function signature?

`util.inspect(object, [showHidden], [depth], [colors])` has been deprecated.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’d put this closer to the end of the description… this is probably not relevant to a lot of people (and if it is, we shouldn’t deprecate it)


The `util.inspect()` method returns a string representation of `object` that is
intended for debugging. The output of `util.inspect` may change at any time
and should not be depended upon programmatically. Additional `options` may be
Expand Down