Skip to content

Commit

Permalink
doc: replace function with arrow function
Browse files Browse the repository at this point in the history
PR-URL: #17304
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Ron Korving <ron@ronkorving.nl>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
Leko authored and MylesBorins committed Dec 12, 2017
1 parent 284dad7 commit 078b4a6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions doc/api/util.md
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,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 @@ -529,7 +529,7 @@ function doSomething(foo, callback) {
// ...
}

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

Expand All @@ -544,8 +544,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

0 comments on commit 078b4a6

Please sign in to comment.