From 2d01268e32e3ae5c2bbc68351f9daf171e82a098 Mon Sep 17 00:00:00 2001 From: Sho Miyamoto Date: Wed, 14 Feb 2018 16:18:04 +0900 Subject: [PATCH 1/2] doc: fix a typo in util.isDeepStrictEqual --- doc/api/util.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/util.md b/doc/api/util.md index 7475e36f1c2013..328e653433c0b8 100644 --- a/doc/api/util.md +++ b/doc/api/util.md @@ -491,7 +491,7 @@ added: v9.0.0 * `val2` {any} * Returns: {boolean} -Returns `true` if there is deep strict equality between `val` and `val2`. +Returns `true` if there is deep strict equality between `val1` and `val2`. Otherwise, returns `false`. See [`assert.deepStrictEqual()`][] for more information about deep strict From fde0d989b355ae103dd34765cde69ef514495686 Mon Sep 17 00:00:00 2001 From: Sho Miyamoto Date: Wed, 14 Feb 2018 16:17:14 +0900 Subject: [PATCH 2/2] doc: add missing `Returns` in fs & util --- doc/api/fs.md | 16 ++++++++++++++++ doc/api/util.md | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/doc/api/fs.md b/doc/api/fs.md index dee32e8696a7c2..34320bcf1fdafa 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -1198,6 +1198,7 @@ changes: * `start` {integer} * `end` {integer} * `highWaterMark` {integer} +* Returns: {ReadStream} Returns a new [`ReadStream`][] object. (See [Readable Streams][]). @@ -1273,6 +1274,7 @@ changes: * `mode` {integer} * `autoClose` {boolean} * `start` {integer} +* Returns: {WriteStream} Returns a new [`WriteStream`][] object. (See [Writable Stream][]). @@ -1428,6 +1430,7 @@ changes: --> * `path` {string|Buffer|URL} +* Returns: {boolean} Synchronous version of [`fs.exists()`][]. Returns `true` if the path exists, `false` otherwise. @@ -1546,6 +1549,7 @@ added: v0.1.95 --> * `fd` {integer} +* Returns: {fs.Stats} Synchronous fstat(2). Returns an instance of [`fs.Stats`][]. @@ -1820,6 +1824,7 @@ changes: --> * `path` {string|Buffer|URL} +* Returns: {fs.Stats} Synchronous lstat(2). Returns an instance of [`fs.Stats`][]. @@ -1945,6 +1950,7 @@ added: v5.10.0 * `prefix` {string} * `options` {string|Object} * `encoding` {string} **Default:** `'utf8'` +* Returns: {string} The synchronous version of [`fs.mkdtemp()`][]. Returns the created folder path. @@ -2069,6 +2075,7 @@ changes: * `path` {string|Buffer|URL} * `flags` {string|number} * `mode` {integer} **Default:** `0o666` +* Returns: {number} Synchronous version of [`fs.open()`][]. Returns an integer representing the file descriptor. @@ -2159,6 +2166,7 @@ changes: * `path` {string|Buffer|URL} * `options` {string|Object} * `encoding` {string} **Default:** `'utf8'` +* Returns: {Array} An array of filenames Synchronous readdir(3). Returns an array of filenames excluding `'.'` and `'..'`. @@ -2260,6 +2268,7 @@ changes: * `options` {Object|string} * `encoding` {string|null} **Default:** `null` * `flag` {string} **Default:** `'r'` +* Returns: {string|Buffer} Synchronous version of [`fs.readFile()`][]. Returns the contents of the `path`. @@ -2320,6 +2329,7 @@ changes: * `path` {string|Buffer|URL} * `options` {string|Object} * `encoding` {string} **Default:** `'utf8'` +* Returns: {string|Buffer} Synchronous readlink(2). Returns the symbolic link's string value. @@ -2342,6 +2352,7 @@ changes: * `offset` {integer} * `length` {integer} * `position` {integer} +* Returns: {number} Synchronous version of [`fs.read()`][]. Returns the number of `bytesRead`. @@ -2452,6 +2463,7 @@ changes: * `path` {string|Buffer|URL} * `options` {string|Object} * `encoding` {string} **Default:** `'utf8'` +* Returns: {string|Buffer} Synchronously computes the canonical pathname by resolving `.`, `..` and symbolic links. @@ -2482,6 +2494,7 @@ added: v9.2.0 * `path` {string|Buffer|URL} * `options` {string|Object} * `encoding` {string} **Default:** `'utf8'` +* Returns: {string|Buffer} Synchronous realpath(3). @@ -2619,6 +2632,7 @@ changes: --> * `path` {string|Buffer|URL} +* Returns: {fs.Stats} Synchronous stat(2). Returns an instance of [`fs.Stats`][]. @@ -3197,6 +3211,7 @@ changes: * `offset` {integer} * `length` {integer} * `position` {integer} +* Returns: {number} ## fs.writeSync(fd, string[, position[, encoding]])