Skip to content

Commit 53d87b3

Browse files
Lekojasnell
authored andcommitted
doc: replace function with arrow function
PR-URL: #17304 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Ron Korving <[email protected]> Reviewed-By: Yuta Hiroto <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Daijiro Wachi <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Jon Moss <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 3cf0db5 commit 53d87b3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

doc/api/util.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ but may return a value of any type that will be formatted accordingly by
439439
const util = require('util');
440440

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

@@ -549,7 +549,7 @@ function doSomething(foo, callback) {
549549
// ...
550550
}
551551

552-
doSomething[util.promisify.custom] = function(foo) {
552+
doSomething[util.promisify.custom] = (foo) => {
553553
return getPromiseSomehow();
554554
};
555555

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

566566
```js
567-
doSomething[util.promisify.custom] = function(foo) {
568-
return new Promise(function(resolve, reject) {
567+
doSomething[util.promisify.custom] = (foo) => {
568+
return new Promise((resolve, reject) => {
569569
doSomething(foo, resolve, reject);
570570
});
571571
};

0 commit comments

Comments
 (0)