From 11f02cd097c05c6d44c369d83cd9b916c30af29d Mon Sep 17 00:00:00 2001 From: Hubert Argasinski Date: Fri, 28 Jan 2022 15:42:45 -0500 Subject: docs: add missing return definitions for awaitable functions (#1789) --- lib/detect.js | 2 +- lib/detectLimit.js | 2 +- lib/detectSeries.js | 2 +- lib/race.js | 2 +- lib/waterfall.js | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/detect.js b/lib/detect.js index 43fab1e..5c8fd6e 100644 --- a/lib/detect.js +++ b/lib/detect.js @@ -27,7 +27,7 @@ import awaitify from './internal/awaitify.js' * Result will be the first item in the array that passes the truth test * (iteratee) or the value `undefined` if none passed. Invoked with * (err, result). - * @returns A Promise, if no callback is passed + * @returns {Promise} a promise, if a callback is omitted * @example * * // dir1 is a directory that contains file1.txt, file2.txt diff --git a/lib/detectLimit.js b/lib/detectLimit.js index 8ba89a0..0765fe8 100644 --- a/lib/detectLimit.js +++ b/lib/detectLimit.js @@ -23,7 +23,7 @@ import awaitify from './internal/awaitify.js' * Result will be the first item in the array that passes the truth test * (iteratee) or the value `undefined` if none passed. Invoked with * (err, result). - * @returns a Promise if no callback is passed + * @returns {Promise} a promise, if a callback is omitted */ function detectLimit(coll, limit, iteratee, callback) { return createTester(bool => bool, (res, item) => item)(eachOfLimit(limit), coll, iteratee, callback) diff --git a/lib/detectSeries.js b/lib/detectSeries.js index 18a7b17..4cc9d2b 100644 --- a/lib/detectSeries.js +++ b/lib/detectSeries.js @@ -21,7 +21,7 @@ import awaitify from './internal/awaitify.js' * Result will be the first item in the array that passes the truth test * (iteratee) or the value `undefined` if none passed. Invoked with * (err, result). - * @returns a Promise if no callback is passed + * @returns {Promise} a promise, if a callback is omitted */ function detectSeries(coll, iteratee, callback) { return createTester(bool => bool, (res, item) => item)(eachOfLimit(1), coll, iteratee, callback) diff --git a/lib/race.js b/lib/race.js index 0d4d4bf..6cbe513 100644 --- a/lib/race.js +++ b/lib/race.js @@ -18,7 +18,7 @@ import awaitify from './internal/awaitify.js' * @param {Function} callback - A callback to run once any of the functions have * completed. This function gets an error or result from the first function that * completed. Invoked with (err, result). - * @returns undefined + * @returns {Promise} a promise, if a callback is omitted * @example * * async.race([ diff --git a/lib/waterfall.js b/lib/waterfall.js index 92783b2..e29ea42 100644 --- a/lib/waterfall.js +++ b/lib/waterfall.js @@ -21,7 +21,7 @@ import awaitify from './internal/awaitify.js' * @param {Function} [callback] - An optional callback to run once all the * functions have completed. This will be passed the results of the last task's * callback. Invoked with (err, [results]). - * @returns undefined + * @returns {Promise} a promise, if a callback is omitted * @example * * async.waterfall([ -- cgit v1.2.1