summaryrefslogtreecommitdiff
path: root/doc/api/util.md
diff options
context:
space:
mode:
authorVse Mozhet Byt <vsemozhetbyt@gmail.com>2018-04-29 14:16:44 +0300
committerVse Mozhet Byt <vsemozhetbyt@gmail.com>2018-05-02 06:17:08 +0300
commit392d80a617fab8630e3f017076f1f59403db6470 (patch)
tree8569c662136f6b70e58612b0130ae7dbfb12e110 /doc/api/util.md
parent536b1fbd3ff38df3d5e8eb0b011820fd94f68b9d (diff)
downloadandroid-node-v8-392d80a617fab8630e3f017076f1f59403db6470.tar.gz
android-node-v8-392d80a617fab8630e3f017076f1f59403db6470.tar.bz2
android-node-v8-392d80a617fab8630e3f017076f1f59403db6470.zip
doc: add missing periods or colons
Some other formatting nits were fixed and some superfluous descriptions were simplified in passing. PR-URL: https://github.com/nodejs/node/pull/20401 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'doc/api/util.md')
-rw-r--r--doc/api/util.md25
1 files changed, 13 insertions, 12 deletions
diff --git a/doc/api/util.md b/doc/api/util.md
index 70f826fd90..8ed8c0b2c9 100644
--- a/doc/api/util.md
+++ b/doc/api/util.md
@@ -54,18 +54,19 @@ Since `null` has a special meaning as the first argument to a callback, if a
wrapped function rejects a `Promise` with a falsy value as a reason, the value
is wrapped in an `Error` with the original value stored in a field named
`reason`.
- ```js
- function fn() {
- return Promise.reject(null);
- }
- const callbackFunction = util.callbackify(fn);
- callbackFunction((err, ret) => {
- // When the Promise was rejected with `null` it is wrapped with an Error and
- // the original value is stored in `reason`.
- err && err.hasOwnProperty('reason') && err.reason === null; // true
- });
- ```
+```js
+function fn() {
+ return Promise.reject(null);
+}
+const callbackFunction = util.callbackify(fn);
+
+callbackFunction((err, ret) => {
+ // When the Promise was rejected with `null` it is wrapped with an Error and
+ // the original value is stored in `reason`.
+ err && err.hasOwnProperty('reason') && err.reason === null; // true
+});
+```
## util.debuglog(section)
<!-- YAML
@@ -339,7 +340,7 @@ stream.on('data', (data) => {
stream.write('It works!'); // Received data: "It works!"
```
-ES6 example using `class` and `extends`
+ES6 example using `class` and `extends`:
```js
const EventEmitter = require('events');