From eda57a91604571e22fe0a032b68bc54c0eab1d4c Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sat, 4 Dec 2021 19:59:24 -0800 Subject: [PATCH] lib: use consistent types in JSDoc @returns MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/41089 Reviewed-By: Michaƫl Zasso Reviewed-By: Ruben Bridgewater --- lib/assert.js | 1 - lib/events.js | 2 +- lib/fs.js | 2 +- lib/internal/modules/esm/resolve.js | 2 +- 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/assert.js b/lib/assert.js index 46d6102381a450..1998246e09c15a 100644 --- a/lib/assert.js +++ b/lib/assert.js @@ -129,7 +129,6 @@ function innerFail(obj) { * @param {string | Error} [message] * @param {string} [operator] * @param {Function} [stackStartFn] - * @returns {never} */ function fail(actual, expected, message, operator, stackStartFn) { const argsLen = arguments.length; diff --git a/lib/events.js b/lib/events.js index 71776c6e8f6f00..b11f2f7181d9ee 100644 --- a/lib/events.js +++ b/lib/events.js @@ -79,7 +79,7 @@ const kMaxEventTargetListenersWarned = /** * Creates a new `EventEmitter` instance. * @param {{ captureRejections?: boolean; }} [opts] - * @returns {EventEmitter} + * @constructs {EventEmitter} */ function EventEmitter(opts) { EventEmitter.init.call(this, opts); diff --git a/lib/fs.js b/lib/fs.js index 86fb163f2a428c..729d8aeae8cc70 100644 --- a/lib/fs.js +++ b/lib/fs.js @@ -239,7 +239,7 @@ function access(path, mode, callback) { * directory specified by `path`. * @param {string | Buffer | URL} path * @param {number} [mode] - * @returns {void | never} + * @returns {void} */ function accessSync(path, mode) { path = getValidatedPath(path); diff --git a/lib/internal/modules/esm/resolve.js b/lib/internal/modules/esm/resolve.js index 2605ef26233f4c..9f14316fe3f71d 100644 --- a/lib/internal/modules/esm/resolve.js +++ b/lib/internal/modules/esm/resolve.js @@ -128,7 +128,7 @@ function emitTrailingSlashPatternDeprecation(match, pjsonUrl, isExports, base) { * @param {URL} packageJSONUrl * @param {string | URL | undefined} base * @param {string} main - * @returns + * @returns {void} */ function emitLegacyIndexDeprecation(url, packageJSONUrl, base, main) { const format = defaultGetFormat(url);