| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 284dad7 commit 078b4a6
1 file 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 | ||
@@ -529,7 +529,7 @@ function doSomething(foo, callback) { | |||
| 529 | 529 | // ... | |
| 530 | 530 | } | |
| 531 | 531 | ||
| 532 | - doSomething[util.promisify.custom] = function(foo) { | ||
| 532 | + doSomething[util.promisify.custom] = (foo) => { | ||
| 533 | 533 | return getPromiseSomehow(); | |
| 534 | 534 | }; | |
| 535 | 535 | ||
@@ -544,8 +544,8 @@ standard format of taking an error-first callback as the last argument. | |||
| 544 | 544 | For example, with a function that takes in `(foo, onSuccessCallback, onErrorCallback)`: | |
| 545 | 545 | ||
| 546 | 546 | ```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) => { | ||
| 549 | 549 | doSomething(foo, resolve, reject); | |
| 550 | 550 | }); | |
| 551 | 551 | }; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments