diff options
author | Ruben Bridgewater <ruben@bridgewater.de> | 2018-05-14 18:44:30 +0200 |
---|---|---|
committer | Ruben Bridgewater <ruben@bridgewater.de> | 2018-05-19 19:30:58 +0200 |
commit | 27df81cd1874e5392bbfa479543e47dd226f322a (patch) | |
tree | d4eb0c03f475164ce9dc82c8c513eba197511319 /doc/api/util.md | |
parent | 456a8193cb6d7ba3514c14c64130c3f5c5fcd198 (diff) | |
download | android-node-v8-27df81cd1874e5392bbfa479543e47dd226f322a.tar.gz android-node-v8-27df81cd1874e5392bbfa479543e47dd226f322a.tar.bz2 android-node-v8-27df81cd1874e5392bbfa479543e47dd226f322a.zip |
util: remove custom inspection function
This removes the deprecated custom inspection function and fixes
all tests accordingly.
Refs: https://github.com/nodejs/node/issues/15549
PR-URL: https://github.com/nodejs/node/pull/20722
Refs: https://github.com/nodejs/node/issues/15549
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'doc/api/util.md')
-rw-r--r-- | doc/api/util.md | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/doc/api/util.md b/doc/api/util.md index bec24e6410..5374fe0f49 100644 --- a/doc/api/util.md +++ b/doc/api/util.md @@ -393,8 +393,9 @@ changes: * `colors` {boolean} If `true`, the output will be styled with ANSI color codes. Colors are customizable, see [Customizing `util.inspect` colors][]. **Default:** `false`. - * `customInspect` {boolean} If `false`, then custom `inspect(depth, opts)` - functions will not be called. **Default:** `true`. + * `customInspect` {boolean} If `false`, then + `[util.inspect.custom](depth, opts)` functions will not be called. + **Default:** `true`. * `showProxy` {boolean} If `true`, then objects and functions that are `Proxy` objects will be introspected to show their `target` and `handler` objects. **Default:** `false`. @@ -416,7 +417,6 @@ changes: objects the same as arrays. Note that no text will be reduced below 16 characters, no matter the `breakLength` size. For more information, see the example below. **Default:** `true`. - * Returns: {string} The representation of passed object The `util.inspect()` method returns a string representation of `object` that is @@ -450,10 +450,6 @@ const util = require('util'); console.log(util.inspect(util, { showHidden: true, depth: null })); ``` -Values may supply their own custom `inspect(depth, opts)` functions, when -called these receive the current `depth` in the recursive inspection, as well as -the options object passed to `util.inspect()`. - The following example highlights the difference with the `compact` option: ```js @@ -568,9 +564,9 @@ terminals. <!-- type=misc --> -Objects may also define their own `[util.inspect.custom](depth, opts)` -(or the equivalent but deprecated `inspect(depth, opts)`) function that -`util.inspect()` will invoke and use the result of when inspecting the object: +Objects may also define their own `[util.inspect.custom](depth, opts)` function +that `util.inspect()` will invoke and use the result of when inspecting the +object: ```js const util = require('util'); |