diff options
Diffstat (limited to 'lib/mapValuesLimit.js')
-rw-r--r-- | lib/mapValuesLimit.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/mapValuesLimit.js b/lib/mapValuesLimit.js index bced034..f6e72ff 100644 --- a/lib/mapValuesLimit.js +++ b/lib/mapValuesLimit.js @@ -1,5 +1,8 @@ import eachOfLimit from './eachOfLimit'; +import noop from 'lodash/noop'; +import once from './internal/once'; + /** * The same as [`mapValues`]{@link module:Collections.mapValues} but runs a maximum of `limit` async operations at a * time. @@ -21,6 +24,7 @@ import eachOfLimit from './eachOfLimit'; * transformed values from the `obj`. Invoked with (err, result). */ export default function mapValuesLimit(obj, limit, iteratee, callback) { + callback = once(callback || noop); var newObj = {}; eachOfLimit(obj, limit, function(val, key, next) { iteratee(val, key, function (err, result) { |