From 392d80a617fab8630e3f017076f1f59403db6470 Mon Sep 17 00:00:00 2001 From: Vse Mozhet Byt Date: Sun, 29 Apr 2018 14:16:44 +0300 Subject: 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 Reviewed-By: Gireesh Punathil Reviewed-By: Trivikram Kamat Reviewed-By: Colin Ihrig --- doc/api/util.md | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'doc/api/util.md') 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)