1 | 'use strict';
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 | exports.default = mapValuesLimit;
|
7 |
|
8 | var _eachOfLimit = require('./eachOfLimit');
|
9 |
|
10 | var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit);
|
11 |
|
12 | var _noop = require('lodash/noop');
|
13 |
|
14 | var _noop2 = _interopRequireDefault(_noop);
|
15 |
|
16 | var _once = require('./internal/once');
|
17 |
|
18 | var _once2 = _interopRequireDefault(_once);
|
19 |
|
20 | var _wrapAsync = require('./internal/wrapAsync');
|
21 |
|
22 | var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
|
23 |
|
24 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 |
|
43 |
|
44 |
|
45 |
|
46 |
|
47 | function mapValuesLimit(obj, limit, iteratee, callback) {
|
48 | callback = (0, _once2.default)(callback || _noop2.default);
|
49 | var newObj = {};
|
50 | var _iteratee = (0, _wrapAsync2.default)(iteratee);
|
51 | (0, _eachOfLimit2.default)(obj, limit, function (val, key, next) {
|
52 | _iteratee(val, key, function (err, result) {
|
53 | if (err) return next(err);
|
54 | newObj[key] = result;
|
55 | next();
|
56 | });
|
57 | }, function (err) {
|
58 | callback(err, newObj);
|
59 | });
|
60 | }
|
61 | module.exports = exports['default']; |
\ | No newline at end of file |