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
8 changes: 4 additions & 4 deletions doc/api/util.md
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ but may return a value of any type that will be formatted accordingly by
const util = require('util');

const obj = { foo: 'this will not show up in the inspect() output' };
obj[util.inspect.custom] = function(depth) {
obj[util.inspect.custom] = (depth) => {
return { bar: 'baz' };
};

Expand Down Expand Up @@ -549,7 +549,7 @@ function doSomething(foo, callback) {
// ...
}

doSomething[util.promisify.custom] = function(foo) {
doSomething[util.promisify.custom] = (foo) => {
return getPromiseSomehow();
};

Expand All @@ -564,8 +564,8 @@ standard format of taking an error-first callback as the last argument.
For example, with a function that takes in `(foo, onSuccessCallback, onErrorCallback)`:

```js
doSomething[util.promisify.custom] = function(foo) {
return new Promise(function(resolve, reject) {
doSomething[util.promisify.custom] = (foo) => {
return new Promise((resolve, reject) => {
doSomething(foo, resolve, reject);
});
};
Expand Down