Skip to content

Commit 078b4a6

Browse files
LekoMylesBorins
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 284dad7 commit 078b4a6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

doc/api/util.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ but may return a value of any type that will be formatted accordingly by
419419
const util = require('util');
420420

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

@@ -529,7 +529,7 @@ function doSomething(foo, callback) {
529529
// ...
530530
}
531531

532-
doSomething[util.promisify.custom] = function(foo) {
532+
doSomething[util.promisify.custom] = (foo) => {
533533
return getPromiseSomehow();
534534
};
535535

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

546546
```js
547-
doSomething[util.promisify.custom] = function(foo) {
548-
return new Promise(function(resolve, reject) {
547+
doSomething[util.promisify.custom] = (foo) => {
548+
return new Promise((resolve, reject) => {
549549
doSomething(foo, resolve, reject);
550550
});
551551
};

0 commit comments

Comments
 (0)