summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHubert Argasinski <argasinski.hubert@gmail.com>2022-01-28 15:42:45 -0500
committerGitHub <noreply@github.com>2022-01-28 12:42:45 -0800
commit11f02cd097c05c6d44c369d83cd9b916c30af29d (patch)
tree3f02ed718cfd8cc48305128d72f80db0376bb575
parent139c99db40da6e811c55664ab872ab7d3c8c8c10 (diff)
downloadasync-11f02cd097c05c6d44c369d83cd9b916c30af29d.tar.gz
docs: add missing return definitions for awaitable functions (#1789)
-rw-r--r--lib/detect.js2
-rw-r--r--lib/detectLimit.js2
-rw-r--r--lib/detectSeries.js2
-rw-r--r--lib/race.js2
-rw-r--r--lib/waterfall.js2
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([