From 7a252d05bca5e1cd8d6bb6ce2a70942806fe1a2f Mon Sep 17 00:00:00 2001 From: Mike McNeil Date: Thu, 13 Oct 2016 00:02:29 -0500 Subject: docs: fix copy/paste typo Replace "array" with "object" (looks like it was likely a copy/paste error from when these docs were originally brought over from `.map()`), and rephrase the sentence accordingly. I also normalized an occurrence of "result" vs. "results" to match. > *NOTE:* I did not yet go through and do the same to `.mapValuesLimit()` and `.mapValuesSeries()` in this commit. I'm happy to take care of that in this PR, but it's purely a matter of copy and pasting the relevant comments. --- lib/mapValues.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/mapValues.js b/lib/mapValues.js index a0a9470..c3daa56 100644 --- a/lib/mapValues.js +++ b/lib/mapValues.js @@ -26,8 +26,9 @@ import doLimit from './internal/doLimit'; * called once it has completed with an error (which can be `null`) and a * transformed value. Invoked with (value, key, callback). * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. Results is an array of the - * transformed items from the `obj`. Invoked with (err, result). + * functions have finished, or an error occurs. `result` is a new object consisting + * of each key from `obj`, with each transformed result on the right-hand side. + * Invoked with (err, result). * @example * * async.mapValues({ @@ -37,7 +38,7 @@ import doLimit from './internal/doLimit'; * }, function (file, key, callback) { * fs.stat(file, callback); * }, function(err, result) { - * // results is now a map of stats for each file, e.g. + * // result is now a map of stats for each file, e.g. * // { * // f1: [stats for file1], * // f2: [stats for file2], -- cgit v1.2.1 From 87185be19b01cc824e8ca3270d5516920d3c6e8e Mon Sep 17 00:00:00 2001 From: Mike McNeil Date: Thu, 13 Oct 2016 22:43:07 -0500 Subject: update docs for mapValuesLimit same as https://github.com/caolan/async/pull/1304/commits/7a252d05bca5e1cd8d6bb6ce2a70942806fe1a2f but for `mapValuesLimit` --- lib/mapValuesSeries.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/mapValuesSeries.js b/lib/mapValuesSeries.js index b97fcd1..10c74ea 100644 --- a/lib/mapValuesSeries.js +++ b/lib/mapValuesSeries.js @@ -16,7 +16,8 @@ import doLimit from './internal/doLimit'; * once it has completed with an error (which can be `null`) and a * transformed value. Invoked with (value, key, callback). * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. Result is an object of the - * transformed values from the `obj`. Invoked with (err, result). + * functions have finished, or an error occurs. `result` is a new object consisting + * of each key from `obj`, with each transformed result on the right-hand side. + * Invoked with (err, result). */ export default doLimit(mapValuesLimit, 1); -- cgit v1.2.1 From f321fe835fabc93896d0b0bcb0a350f1d2f45c69 Mon Sep 17 00:00:00 2001 From: Mike McNeil Date: Thu, 13 Oct 2016 22:46:00 -0500 Subject: update docs for mapValueEach same as https://github.com/caolan/async/pull/1304/commits/7a252d05bca5e1cd8d6bb6ce2a70942806fe1a2f but for `mapValuesLimit` --- lib/mapValuesLimit.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/mapValuesLimit.js b/lib/mapValuesLimit.js index f6e72ff..6c9fe06 100644 --- a/lib/mapValuesLimit.js +++ b/lib/mapValuesLimit.js @@ -20,8 +20,9 @@ import once from './internal/once'; * once it has completed with an error (which can be `null`) and a * transformed value. Invoked with (value, key, callback). * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. Result is an object of the - * transformed values from the `obj`. Invoked with (err, result). + * functions have finished, or an error occurs. `result` is a new object consisting + * of each key from `obj`, with each transformed value on the right-hand side. + * Invoked with (err, result). */ export default function mapValuesLimit(obj, limit, iteratee, callback) { callback = once(callback || noop); -- cgit v1.2.1 From d7f9edc9541d5c14cc7810994927cc1276385166 Mon Sep 17 00:00:00 2001 From: Mike McNeil Date: Thu, 13 Oct 2016 22:46:33 -0500 Subject: verbiage: use "value" instead of "result" to avoid confusion and be more consistent with https://github.com/mikermcneil/async/blob/patch-1/lib/mapValuesLimit.js --- lib/mapValuesSeries.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mapValuesSeries.js b/lib/mapValuesSeries.js index 10c74ea..c1530c2 100644 --- a/lib/mapValuesSeries.js +++ b/lib/mapValuesSeries.js @@ -17,7 +17,7 @@ import doLimit from './internal/doLimit'; * transformed value. Invoked with (value, key, callback). * @param {Function} [callback] - A callback which is called when all `iteratee` * functions have finished, or an error occurs. `result` is a new object consisting - * of each key from `obj`, with each transformed result on the right-hand side. + * of each key from `obj`, with each transformed value on the right-hand side. * Invoked with (err, result). */ export default doLimit(mapValuesLimit, 1); -- cgit v1.2.1 From 4eb1707934a52b40faf71143ec7c57739a872ea5 Mon Sep 17 00:00:00 2001 From: Mike McNeil Date: Thu, 13 Oct 2016 22:47:10 -0500 Subject: Verbiage: same as previous commit: use "value" instead of "result" for clarity --- lib/mapValues.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mapValues.js b/lib/mapValues.js index c3daa56..afc43f4 100644 --- a/lib/mapValues.js +++ b/lib/mapValues.js @@ -27,7 +27,7 @@ import doLimit from './internal/doLimit'; * transformed value. Invoked with (value, key, callback). * @param {Function} [callback] - A callback which is called when all `iteratee` * functions have finished, or an error occurs. `result` is a new object consisting - * of each key from `obj`, with each transformed result on the right-hand side. + * of each key from `obj`, with each transformed value on the right-hand side. * Invoked with (err, result). * @example * -- cgit v1.2.1