File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -419,7 +419,7 @@ but may return a value of any type that will be formatted accordingly by
419
419
const util = require (' util' );
420
420
421
421
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 ) => {
423
423
return { bar: ' baz' };
424
424
};
425
425
@@ -514,7 +514,7 @@ function doSomething(foo, callback) {
514
514
// ...
515
515
}
516
516
517
- doSomething[util .promisify .custom ] = function (foo ) {
517
+ doSomething[util .promisify .custom ] = (foo ) => {
518
518
return getPromiseSomehow ();
519
519
};
520
520
@@ -529,8 +529,8 @@ standard format of taking an error-first callback as the last argument.
529
529
For example, with a function that takes in ` (foo, onSuccessCallback, onErrorCallback) ` :
530
530
531
531
``` js
532
- doSomething[util .promisify .custom ] = function (foo ) {
533
- return new Promise (function (resolve , reject ) {
532
+ doSomething[util .promisify .custom ] = (foo ) => {
533
+ return new Promise ((resolve , reject ) => {
534
534
doSomething (foo, resolve, reject);
535
535
});
536
536
};
You can’t perform that action at this time.
0 commit comments