@contrast/agent 4.16.1 → 4.16.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/VERSION +1 -1
- package/bin/linux/contrast-service +0 -0
- package/bin/mac/contrast-service +0 -0
- package/bin/windows/contrast-service.exe +0 -0
- package/lib/protect/rules/cmd-injection/cmdinjection-rule.js +1 -1
- package/node_modules/async/CHANGELOG.md +13 -0
- package/node_modules/async/all.js +74 -9
- package/node_modules/async/allLimit.js +3 -3
- package/node_modules/async/allSeries.js +3 -3
- package/node_modules/async/any.js +75 -9
- package/node_modules/async/anyLimit.js +3 -3
- package/node_modules/async/anySeries.js +3 -3
- package/node_modules/async/applyEach.js +2 -2
- package/node_modules/async/applyEachSeries.js +2 -2
- package/node_modules/async/asyncify.js +3 -3
- package/node_modules/async/auto.js +81 -15
- package/node_modules/async/autoInject.js +30 -4
- package/node_modules/async/cargo.js +1 -1
- package/node_modules/async/cargoQueue.js +1 -1
- package/node_modules/async/compose.js +1 -1
- package/node_modules/async/concat.js +72 -4
- package/node_modules/async/concatLimit.js +3 -3
- package/node_modules/async/concatSeries.js +2 -2
- package/node_modules/async/detect.js +43 -8
- package/node_modules/async/detectLimit.js +3 -3
- package/node_modules/async/detectSeries.js +3 -3
- package/node_modules/async/dir.js +1 -1
- package/node_modules/async/dist/async.js +1379 -168
- package/node_modules/async/dist/async.min.js +1 -1
- package/node_modules/async/dist/async.mjs +1372 -161
- package/node_modules/async/doDuring.js +3 -3
- package/node_modules/async/doUntil.js +2 -2
- package/node_modules/async/doWhilst.js +3 -3
- package/node_modules/async/during.js +3 -3
- package/node_modules/async/each.js +69 -28
- package/node_modules/async/eachLimit.js +4 -4
- package/node_modules/async/eachOf.js +85 -16
- package/node_modules/async/eachOfLimit.js +3 -3
- package/node_modules/async/eachOfSeries.js +2 -2
- package/node_modules/async/eachSeries.js +2 -2
- package/node_modules/async/ensureAsync.js +2 -2
- package/node_modules/async/every.js +74 -9
- package/node_modules/async/everyLimit.js +3 -3
- package/node_modules/async/everySeries.js +3 -3
- package/node_modules/async/filter.js +49 -9
- package/node_modules/async/filterLimit.js +3 -3
- package/node_modules/async/filterSeries.js +3 -3
- package/node_modules/async/find.js +43 -8
- package/node_modules/async/findLimit.js +3 -3
- package/node_modules/async/findSeries.js +3 -3
- package/node_modules/async/flatMap.js +72 -4
- package/node_modules/async/flatMapLimit.js +3 -3
- package/node_modules/async/flatMapSeries.js +2 -2
- package/node_modules/async/foldl.js +87 -11
- package/node_modules/async/foldr.js +2 -2
- package/node_modules/async/forEach.js +69 -28
- package/node_modules/async/forEachLimit.js +4 -4
- package/node_modules/async/forEachOf.js +85 -16
- package/node_modules/async/forEachOfLimit.js +3 -3
- package/node_modules/async/forEachOfSeries.js +2 -2
- package/node_modules/async/forEachSeries.js +2 -2
- package/node_modules/async/forever.js +4 -4
- package/node_modules/async/groupBy.js +62 -8
- package/node_modules/async/groupByLimit.js +3 -3
- package/node_modules/async/groupBySeries.js +2 -2
- package/node_modules/async/inject.js +87 -11
- package/node_modules/async/internal/applyEach.js +2 -2
- package/node_modules/async/internal/asyncEachOfLimit.js +1 -1
- package/node_modules/async/internal/consoleFunc.js +5 -1
- package/node_modules/async/internal/createTester.js +2 -2
- package/node_modules/async/internal/eachOfLimit.js +6 -6
- package/node_modules/async/internal/filter.js +2 -2
- package/node_modules/async/internal/iterator.js +5 -2
- package/node_modules/async/internal/map.js +1 -1
- package/node_modules/async/internal/parallel.js +3 -3
- package/node_modules/async/internal/queue.js +4 -4
- package/node_modules/async/internal/reject.js +2 -2
- package/node_modules/async/internal/setImmediate.js +6 -2
- package/node_modules/async/internal/wrapAsync.js +1 -1
- package/node_modules/async/log.js +1 -1
- package/node_modules/async/map.js +86 -6
- package/node_modules/async/mapLimit.js +3 -3
- package/node_modules/async/mapSeries.js +3 -3
- package/node_modules/async/mapValues.js +102 -12
- package/node_modules/async/mapValuesLimit.js +4 -4
- package/node_modules/async/mapValuesSeries.js +1 -1
- package/node_modules/async/memoize.js +3 -3
- package/node_modules/async/nextTick.js +3 -3
- package/node_modules/async/package.json +4 -6
- package/node_modules/async/parallel.js +96 -7
- package/node_modules/async/parallelLimit.js +2 -2
- package/node_modules/async/priorityQueue.js +11 -4
- package/node_modules/async/queue.js +4 -4
- package/node_modules/async/race.js +3 -3
- package/node_modules/async/reduce.js +87 -11
- package/node_modules/async/reduceRight.js +2 -2
- package/node_modules/async/reflect.js +2 -2
- package/node_modules/async/reflectAll.js +1 -1
- package/node_modules/async/reject.js +44 -10
- package/node_modules/async/rejectLimit.js +3 -3
- package/node_modules/async/rejectSeries.js +3 -3
- package/node_modules/async/retry.js +2 -2
- package/node_modules/async/retryable.js +4 -4
- package/node_modules/async/select.js +49 -9
- package/node_modules/async/selectLimit.js +3 -3
- package/node_modules/async/selectSeries.js +3 -3
- package/node_modules/async/seq.js +4 -4
- package/node_modules/async/series.js +112 -12
- package/node_modules/async/setImmediate.js +1 -1
- package/node_modules/async/some.js +75 -9
- package/node_modules/async/someLimit.js +3 -3
- package/node_modules/async/someSeries.js +3 -3
- package/node_modules/async/sortBy.js +121 -19
- package/node_modules/async/timeout.js +2 -2
- package/node_modules/async/times.js +1 -1
- package/node_modules/async/timesLimit.js +3 -3
- package/node_modules/async/timesSeries.js +1 -1
- package/node_modules/async/transform.js +111 -19
- package/node_modules/async/tryEach.js +3 -3
- package/node_modules/async/until.js +3 -3
- package/node_modules/async/waterfall.js +4 -4
- package/node_modules/async/whilst.js +3 -3
- package/node_modules/async/wrapSync.js +3 -3
- package/package.json +1 -1
|
@@ -5,11 +5,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = reject;
|
|
7
7
|
|
|
8
|
-
var _filter = require('./filter');
|
|
8
|
+
var _filter = require('./filter.js');
|
|
9
9
|
|
|
10
10
|
var _filter2 = _interopRequireDefault(_filter);
|
|
11
11
|
|
|
12
|
-
var _wrapAsync = require('./wrapAsync');
|
|
12
|
+
var _wrapAsync = require('./wrapAsync.js');
|
|
13
13
|
|
|
14
14
|
var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
|
|
15
15
|
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
-
/* istanbul ignore file */
|
|
3
2
|
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.fallback = fallback;
|
|
8
7
|
exports.wrap = wrap;
|
|
8
|
+
/* istanbul ignore file */
|
|
9
|
+
|
|
10
|
+
var hasQueueMicrotask = exports.hasQueueMicrotask = typeof queueMicrotask === 'function' && queueMicrotask;
|
|
9
11
|
var hasSetImmediate = exports.hasSetImmediate = typeof setImmediate === 'function' && setImmediate;
|
|
10
12
|
var hasNextTick = exports.hasNextTick = typeof process === 'object' && typeof process.nextTick === 'function';
|
|
11
13
|
|
|
@@ -19,7 +21,9 @@ function wrap(defer) {
|
|
|
19
21
|
|
|
20
22
|
var _defer;
|
|
21
23
|
|
|
22
|
-
if (
|
|
24
|
+
if (hasQueueMicrotask) {
|
|
25
|
+
_defer = queueMicrotask;
|
|
26
|
+
} else if (hasSetImmediate) {
|
|
23
27
|
_defer = setImmediate;
|
|
24
28
|
} else if (hasNextTick) {
|
|
25
29
|
_defer = process.nextTick;
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.isAsyncIterable = exports.isAsyncGenerator = exports.isAsync = undefined;
|
|
7
7
|
|
|
8
|
-
var _asyncify = require('../asyncify');
|
|
8
|
+
var _asyncify = require('../asyncify.js');
|
|
9
9
|
|
|
10
10
|
var _asyncify2 = _interopRequireDefault(_asyncify);
|
|
11
11
|
|
|
@@ -4,15 +4,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
|
|
7
|
-
var _map2 = require('./internal/map');
|
|
7
|
+
var _map2 = require('./internal/map.js');
|
|
8
8
|
|
|
9
9
|
var _map3 = _interopRequireDefault(_map2);
|
|
10
10
|
|
|
11
|
-
var _eachOf = require('./eachOf');
|
|
11
|
+
var _eachOf = require('./eachOf.js');
|
|
12
12
|
|
|
13
13
|
var _eachOf2 = _interopRequireDefault(_eachOf);
|
|
14
14
|
|
|
15
|
-
var _awaitify = require('./internal/awaitify');
|
|
15
|
+
var _awaitify = require('./internal/awaitify.js');
|
|
16
16
|
|
|
17
17
|
var _awaitify2 = _interopRequireDefault(_awaitify);
|
|
18
18
|
|
|
@@ -21,7 +21,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
21
21
|
/**
|
|
22
22
|
* Produces a new collection of values by mapping each value in `coll` through
|
|
23
23
|
* the `iteratee` function. The `iteratee` is called with an item from `coll`
|
|
24
|
-
* and a callback for when it has finished processing. Each of these
|
|
24
|
+
* and a callback for when it has finished processing. Each of these callbacks
|
|
25
25
|
* takes 2 arguments: an `error`, and the transformed item from `coll`. If
|
|
26
26
|
* `iteratee` passes an error to its callback, the main `callback` (for the
|
|
27
27
|
* `map` function) is immediately called with the error.
|
|
@@ -51,9 +51,89 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
51
51
|
* @returns {Promise} a promise, if no callback is passed
|
|
52
52
|
* @example
|
|
53
53
|
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
54
|
+
* // file1.txt is a file that is 1000 bytes in size
|
|
55
|
+
* // file2.txt is a file that is 2000 bytes in size
|
|
56
|
+
* // file3.txt is a file that is 3000 bytes in size
|
|
57
|
+
* // file4.txt does not exist
|
|
58
|
+
*
|
|
59
|
+
* const fileList = ['file1.txt','file2.txt','file3.txt'];
|
|
60
|
+
* const withMissingFileList = ['file1.txt','file2.txt','file4.txt'];
|
|
61
|
+
*
|
|
62
|
+
* // asynchronous function that returns the file size in bytes
|
|
63
|
+
* function getFileSizeInBytes(file, callback) {
|
|
64
|
+
* fs.stat(file, function(err, stat) {
|
|
65
|
+
* if (err) {
|
|
66
|
+
* return callback(err);
|
|
67
|
+
* }
|
|
68
|
+
* callback(null, stat.size);
|
|
69
|
+
* });
|
|
70
|
+
* }
|
|
71
|
+
*
|
|
72
|
+
* // Using callbacks
|
|
73
|
+
* async.map(fileList, getFileSizeInBytes, function(err, results) {
|
|
74
|
+
* if (err) {
|
|
75
|
+
* console.log(err);
|
|
76
|
+
* } else {
|
|
77
|
+
* console.log(results);
|
|
78
|
+
* // results is now an array of the file size in bytes for each file, e.g.
|
|
79
|
+
* // [ 1000, 2000, 3000]
|
|
80
|
+
* }
|
|
81
|
+
* });
|
|
82
|
+
*
|
|
83
|
+
* // Error Handling
|
|
84
|
+
* async.map(withMissingFileList, getFileSizeInBytes, function(err, results) {
|
|
85
|
+
* if (err) {
|
|
86
|
+
* console.log(err);
|
|
87
|
+
* // [ Error: ENOENT: no such file or directory ]
|
|
88
|
+
* } else {
|
|
89
|
+
* console.log(results);
|
|
90
|
+
* }
|
|
91
|
+
* });
|
|
92
|
+
*
|
|
93
|
+
* // Using Promises
|
|
94
|
+
* async.map(fileList, getFileSizeInBytes)
|
|
95
|
+
* .then( results => {
|
|
96
|
+
* console.log(results);
|
|
97
|
+
* // results is now an array of the file size in bytes for each file, e.g.
|
|
98
|
+
* // [ 1000, 2000, 3000]
|
|
99
|
+
* }).catch( err => {
|
|
100
|
+
* console.log(err);
|
|
101
|
+
* });
|
|
102
|
+
*
|
|
103
|
+
* // Error Handling
|
|
104
|
+
* async.map(withMissingFileList, getFileSizeInBytes)
|
|
105
|
+
* .then( results => {
|
|
106
|
+
* console.log(results);
|
|
107
|
+
* }).catch( err => {
|
|
108
|
+
* console.log(err);
|
|
109
|
+
* // [ Error: ENOENT: no such file or directory ]
|
|
56
110
|
* });
|
|
111
|
+
*
|
|
112
|
+
* // Using async/await
|
|
113
|
+
* async () => {
|
|
114
|
+
* try {
|
|
115
|
+
* let results = await async.map(fileList, getFileSizeInBytes);
|
|
116
|
+
* console.log(results);
|
|
117
|
+
* // results is now an array of the file size in bytes for each file, e.g.
|
|
118
|
+
* // [ 1000, 2000, 3000]
|
|
119
|
+
* }
|
|
120
|
+
* catch (err) {
|
|
121
|
+
* console.log(err);
|
|
122
|
+
* }
|
|
123
|
+
* }
|
|
124
|
+
*
|
|
125
|
+
* // Error Handling
|
|
126
|
+
* async () => {
|
|
127
|
+
* try {
|
|
128
|
+
* let results = await async.map(withMissingFileList, getFileSizeInBytes);
|
|
129
|
+
* console.log(results);
|
|
130
|
+
* }
|
|
131
|
+
* catch (err) {
|
|
132
|
+
* console.log(err);
|
|
133
|
+
* // [ Error: ENOENT: no such file or directory ]
|
|
134
|
+
* }
|
|
135
|
+
* }
|
|
136
|
+
*
|
|
57
137
|
*/
|
|
58
138
|
function map(coll, iteratee, callback) {
|
|
59
139
|
return (0, _map3.default)(_eachOf2.default, coll, iteratee, callback);
|
|
@@ -4,15 +4,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
|
|
7
|
-
var _map2 = require('./internal/map');
|
|
7
|
+
var _map2 = require('./internal/map.js');
|
|
8
8
|
|
|
9
9
|
var _map3 = _interopRequireDefault(_map2);
|
|
10
10
|
|
|
11
|
-
var _eachOfLimit = require('./internal/eachOfLimit');
|
|
11
|
+
var _eachOfLimit = require('./internal/eachOfLimit.js');
|
|
12
12
|
|
|
13
13
|
var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit);
|
|
14
14
|
|
|
15
|
-
var _awaitify = require('./internal/awaitify');
|
|
15
|
+
var _awaitify = require('./internal/awaitify.js');
|
|
16
16
|
|
|
17
17
|
var _awaitify2 = _interopRequireDefault(_awaitify);
|
|
18
18
|
|
|
@@ -4,15 +4,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
|
|
7
|
-
var _map2 = require('./internal/map');
|
|
7
|
+
var _map2 = require('./internal/map.js');
|
|
8
8
|
|
|
9
9
|
var _map3 = _interopRequireDefault(_map2);
|
|
10
10
|
|
|
11
|
-
var _eachOfSeries = require('./eachOfSeries');
|
|
11
|
+
var _eachOfSeries = require('./eachOfSeries.js');
|
|
12
12
|
|
|
13
13
|
var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries);
|
|
14
14
|
|
|
15
|
-
var _awaitify = require('./internal/awaitify');
|
|
15
|
+
var _awaitify = require('./internal/awaitify.js');
|
|
16
16
|
|
|
17
17
|
var _awaitify2 = _interopRequireDefault(_awaitify);
|
|
18
18
|
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = mapValues;
|
|
7
7
|
|
|
8
|
-
var _mapValuesLimit = require('./mapValuesLimit');
|
|
8
|
+
var _mapValuesLimit = require('./mapValuesLimit.js');
|
|
9
9
|
|
|
10
10
|
var _mapValuesLimit2 = _interopRequireDefault(_mapValuesLimit);
|
|
11
11
|
|
|
@@ -41,20 +41,110 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
41
41
|
* @returns {Promise} a promise, if no callback is passed
|
|
42
42
|
* @example
|
|
43
43
|
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
44
|
+
* // file1.txt is a file that is 1000 bytes in size
|
|
45
|
+
* // file2.txt is a file that is 2000 bytes in size
|
|
46
|
+
* // file3.txt is a file that is 3000 bytes in size
|
|
47
|
+
* // file4.txt does not exist
|
|
48
|
+
*
|
|
49
|
+
* const fileMap = {
|
|
50
|
+
* f1: 'file1.txt',
|
|
51
|
+
* f2: 'file2.txt',
|
|
52
|
+
* f3: 'file3.txt'
|
|
53
|
+
* };
|
|
54
|
+
*
|
|
55
|
+
* const withMissingFileMap = {
|
|
56
|
+
* f1: 'file1.txt',
|
|
57
|
+
* f2: 'file2.txt',
|
|
58
|
+
* f3: 'file4.txt'
|
|
59
|
+
* };
|
|
60
|
+
*
|
|
61
|
+
* // asynchronous function that returns the file size in bytes
|
|
62
|
+
* function getFileSizeInBytes(file, key, callback) {
|
|
63
|
+
* fs.stat(file, function(err, stat) {
|
|
64
|
+
* if (err) {
|
|
65
|
+
* return callback(err);
|
|
66
|
+
* }
|
|
67
|
+
* callback(null, stat.size);
|
|
68
|
+
* });
|
|
69
|
+
* }
|
|
70
|
+
*
|
|
71
|
+
* // Using callbacks
|
|
72
|
+
* async.mapValues(fileMap, getFileSizeInBytes, function(err, result) {
|
|
73
|
+
* if (err) {
|
|
74
|
+
* console.log(err);
|
|
75
|
+
* } else {
|
|
76
|
+
* console.log(result);
|
|
77
|
+
* // result is now a map of file size in bytes for each file, e.g.
|
|
78
|
+
* // {
|
|
79
|
+
* // f1: 1000,
|
|
80
|
+
* // f2: 2000,
|
|
81
|
+
* // f3: 3000
|
|
82
|
+
* // }
|
|
83
|
+
* }
|
|
84
|
+
* });
|
|
85
|
+
*
|
|
86
|
+
* // Error handling
|
|
87
|
+
* async.mapValues(withMissingFileMap, getFileSizeInBytes, function(err, result) {
|
|
88
|
+
* if (err) {
|
|
89
|
+
* console.log(err);
|
|
90
|
+
* // [ Error: ENOENT: no such file or directory ]
|
|
91
|
+
* } else {
|
|
92
|
+
* console.log(result);
|
|
93
|
+
* }
|
|
94
|
+
* });
|
|
95
|
+
*
|
|
96
|
+
* // Using Promises
|
|
97
|
+
* async.mapValues(fileMap, getFileSizeInBytes)
|
|
98
|
+
* .then( result => {
|
|
99
|
+
* console.log(result);
|
|
100
|
+
* // result is now a map of file size in bytes for each file, e.g.
|
|
52
101
|
* // {
|
|
53
|
-
* // f1:
|
|
54
|
-
* // f2:
|
|
55
|
-
* // f3:
|
|
102
|
+
* // f1: 1000,
|
|
103
|
+
* // f2: 2000,
|
|
104
|
+
* // f3: 3000
|
|
56
105
|
* // }
|
|
106
|
+
* }).catch (err => {
|
|
107
|
+
* console.log(err);
|
|
108
|
+
* });
|
|
109
|
+
*
|
|
110
|
+
* // Error Handling
|
|
111
|
+
* async.mapValues(withMissingFileMap, getFileSizeInBytes)
|
|
112
|
+
* .then( result => {
|
|
113
|
+
* console.log(result);
|
|
114
|
+
* }).catch (err => {
|
|
115
|
+
* console.log(err);
|
|
116
|
+
* // [ Error: ENOENT: no such file or directory ]
|
|
57
117
|
* });
|
|
118
|
+
*
|
|
119
|
+
* // Using async/await
|
|
120
|
+
* async () => {
|
|
121
|
+
* try {
|
|
122
|
+
* let result = await async.mapValues(fileMap, getFileSizeInBytes);
|
|
123
|
+
* console.log(result);
|
|
124
|
+
* // result is now a map of file size in bytes for each file, e.g.
|
|
125
|
+
* // {
|
|
126
|
+
* // f1: 1000,
|
|
127
|
+
* // f2: 2000,
|
|
128
|
+
* // f3: 3000
|
|
129
|
+
* // }
|
|
130
|
+
* }
|
|
131
|
+
* catch (err) {
|
|
132
|
+
* console.log(err);
|
|
133
|
+
* }
|
|
134
|
+
* }
|
|
135
|
+
*
|
|
136
|
+
* // Error Handling
|
|
137
|
+
* async () => {
|
|
138
|
+
* try {
|
|
139
|
+
* let result = await async.mapValues(withMissingFileMap, getFileSizeInBytes);
|
|
140
|
+
* console.log(result);
|
|
141
|
+
* }
|
|
142
|
+
* catch (err) {
|
|
143
|
+
* console.log(err);
|
|
144
|
+
* // [ Error: ENOENT: no such file or directory ]
|
|
145
|
+
* }
|
|
146
|
+
* }
|
|
147
|
+
*
|
|
58
148
|
*/
|
|
59
149
|
function mapValues(obj, iteratee, callback) {
|
|
60
150
|
return (0, _mapValuesLimit2.default)(obj, Infinity, iteratee, callback);
|
|
@@ -4,19 +4,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
|
|
7
|
-
var _eachOfLimit = require('./internal/eachOfLimit');
|
|
7
|
+
var _eachOfLimit = require('./internal/eachOfLimit.js');
|
|
8
8
|
|
|
9
9
|
var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit);
|
|
10
10
|
|
|
11
|
-
var _awaitify = require('./internal/awaitify');
|
|
11
|
+
var _awaitify = require('./internal/awaitify.js');
|
|
12
12
|
|
|
13
13
|
var _awaitify2 = _interopRequireDefault(_awaitify);
|
|
14
14
|
|
|
15
|
-
var _once = require('./internal/once');
|
|
15
|
+
var _once = require('./internal/once.js');
|
|
16
16
|
|
|
17
17
|
var _once2 = _interopRequireDefault(_once);
|
|
18
18
|
|
|
19
|
-
var _wrapAsync = require('./internal/wrapAsync');
|
|
19
|
+
var _wrapAsync = require('./internal/wrapAsync.js');
|
|
20
20
|
|
|
21
21
|
var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
|
|
22
22
|
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = mapValuesSeries;
|
|
7
7
|
|
|
8
|
-
var _mapValuesLimit = require('./mapValuesLimit');
|
|
8
|
+
var _mapValuesLimit = require('./mapValuesLimit.js');
|
|
9
9
|
|
|
10
10
|
var _mapValuesLimit2 = _interopRequireDefault(_mapValuesLimit);
|
|
11
11
|
|
|
@@ -5,15 +5,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = memoize;
|
|
7
7
|
|
|
8
|
-
var _setImmediate = require('./internal/setImmediate');
|
|
8
|
+
var _setImmediate = require('./internal/setImmediate.js');
|
|
9
9
|
|
|
10
10
|
var _setImmediate2 = _interopRequireDefault(_setImmediate);
|
|
11
11
|
|
|
12
|
-
var _initialParams = require('./internal/initialParams');
|
|
12
|
+
var _initialParams = require('./internal/initialParams.js');
|
|
13
13
|
|
|
14
14
|
var _initialParams2 = _interopRequireDefault(_initialParams);
|
|
15
15
|
|
|
16
|
-
var _wrapAsync = require('./internal/wrapAsync');
|
|
16
|
+
var _wrapAsync = require('./internal/wrapAsync.js');
|
|
17
17
|
|
|
18
18
|
var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
|
|
19
19
|
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
-
/* istanbul ignore file */
|
|
3
2
|
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
|
|
8
|
-
var _setImmediate = require('./internal/setImmediate');
|
|
7
|
+
var _setImmediate = require('./internal/setImmediate.js');
|
|
9
8
|
|
|
10
9
|
/**
|
|
11
10
|
* Calls `callback` on a later loop around the event loop. In Node.js this just
|
|
@@ -38,7 +37,8 @@ var _setImmediate = require('./internal/setImmediate');
|
|
|
38
37
|
* // a, b, and c equal 1, 2, and 3
|
|
39
38
|
* }, 1, 2, 3);
|
|
40
39
|
*/
|
|
41
|
-
var _defer;
|
|
40
|
+
var _defer; /* istanbul ignore file */
|
|
41
|
+
|
|
42
42
|
|
|
43
43
|
if (_setImmediate.hasNextTick) {
|
|
44
44
|
_defer = process.nextTick;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "async",
|
|
3
3
|
"description": "Higher-order functions and common patterns for asynchronous code",
|
|
4
|
-
"version": "3.2.
|
|
4
|
+
"version": "3.2.3",
|
|
5
5
|
"main": "dist/async.js",
|
|
6
6
|
"author": "Caolan McMahon",
|
|
7
7
|
"homepage": "https://caolan.github.io/async/",
|
|
@@ -18,7 +18,6 @@
|
|
|
18
18
|
"module",
|
|
19
19
|
"utility"
|
|
20
20
|
],
|
|
21
|
-
"dependencies": {},
|
|
22
21
|
"devDependencies": {
|
|
23
22
|
"babel-core": "^6.26.3",
|
|
24
23
|
"babel-eslint": "^8.2.6",
|
|
@@ -54,7 +53,6 @@
|
|
|
54
53
|
"mocha-junit-reporter": "^1.18.0",
|
|
55
54
|
"native-promise-only": "^0.8.0-a",
|
|
56
55
|
"nyc": "^14.1.1",
|
|
57
|
-
"rimraf": "^2.5.0",
|
|
58
56
|
"rollup": "^0.63.4",
|
|
59
57
|
"rollup-plugin-node-resolve": "^2.0.0",
|
|
60
58
|
"rollup-plugin-npm": "^2.0.0",
|
|
@@ -80,7 +78,7 @@
|
|
|
80
78
|
},
|
|
81
79
|
"module": "dist/async.mjs"
|
|
82
80
|
|
|
83
|
-
,"_resolved": "https://registry.npmjs.org/async/-/async-3.2.
|
|
84
|
-
,"_integrity": "sha512-
|
|
85
|
-
,"_from": "async@3.2.
|
|
81
|
+
,"_resolved": "https://registry.npmjs.org/async/-/async-3.2.3.tgz"
|
|
82
|
+
,"_integrity": "sha512-spZRyzKL5l5BZQrr/6m/SqFdBN0q3OCI0f9rjfBzCMBIP4p75P620rR3gTmaksNOhmzgdxcaxdNfMy6anrbM0g=="
|
|
83
|
+
,"_from": "async@3.2.3"
|
|
86
84
|
}
|
|
@@ -5,11 +5,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = parallel;
|
|
7
7
|
|
|
8
|
-
var _eachOf = require('./eachOf');
|
|
8
|
+
var _eachOf = require('./eachOf.js');
|
|
9
9
|
|
|
10
10
|
var _eachOf2 = _interopRequireDefault(_eachOf);
|
|
11
11
|
|
|
12
|
-
var _parallel2 = require('./internal/parallel');
|
|
12
|
+
var _parallel2 = require('./internal/parallel.js');
|
|
13
13
|
|
|
14
14
|
var _parallel3 = _interopRequireDefault(_parallel2);
|
|
15
15
|
|
|
@@ -51,6 +51,8 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
51
51
|
* @returns {Promise} a promise, if a callback is not passed
|
|
52
52
|
*
|
|
53
53
|
* @example
|
|
54
|
+
*
|
|
55
|
+
* //Using Callbacks
|
|
54
56
|
* async.parallel([
|
|
55
57
|
* function(callback) {
|
|
56
58
|
* setTimeout(function() {
|
|
@@ -62,10 +64,9 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
62
64
|
* callback(null, 'two');
|
|
63
65
|
* }, 100);
|
|
64
66
|
* }
|
|
65
|
-
* ],
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
* // the results array will equal ['one','two'] even though
|
|
67
|
+
* ], function(err, results) {
|
|
68
|
+
* console.log(results);
|
|
69
|
+
* // results is equal to ['one','two'] even though
|
|
69
70
|
* // the second function had a shorter timeout.
|
|
70
71
|
* });
|
|
71
72
|
*
|
|
@@ -82,8 +83,96 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
82
83
|
* }, 100);
|
|
83
84
|
* }
|
|
84
85
|
* }, function(err, results) {
|
|
85
|
-
*
|
|
86
|
+
* console.log(results);
|
|
87
|
+
* // results is equal to: { one: 1, two: 2 }
|
|
86
88
|
* });
|
|
89
|
+
*
|
|
90
|
+
* //Using Promises
|
|
91
|
+
* async.parallel([
|
|
92
|
+
* function(callback) {
|
|
93
|
+
* setTimeout(function() {
|
|
94
|
+
* callback(null, 'one');
|
|
95
|
+
* }, 200);
|
|
96
|
+
* },
|
|
97
|
+
* function(callback) {
|
|
98
|
+
* setTimeout(function() {
|
|
99
|
+
* callback(null, 'two');
|
|
100
|
+
* }, 100);
|
|
101
|
+
* }
|
|
102
|
+
* ]).then(results => {
|
|
103
|
+
* console.log(results);
|
|
104
|
+
* // results is equal to ['one','two'] even though
|
|
105
|
+
* // the second function had a shorter timeout.
|
|
106
|
+
* }).catch(err => {
|
|
107
|
+
* console.log(err);
|
|
108
|
+
* });
|
|
109
|
+
*
|
|
110
|
+
* // an example using an object instead of an array
|
|
111
|
+
* async.parallel({
|
|
112
|
+
* one: function(callback) {
|
|
113
|
+
* setTimeout(function() {
|
|
114
|
+
* callback(null, 1);
|
|
115
|
+
* }, 200);
|
|
116
|
+
* },
|
|
117
|
+
* two: function(callback) {
|
|
118
|
+
* setTimeout(function() {
|
|
119
|
+
* callback(null, 2);
|
|
120
|
+
* }, 100);
|
|
121
|
+
* }
|
|
122
|
+
* }).then(results => {
|
|
123
|
+
* console.log(results);
|
|
124
|
+
* // results is equal to: { one: 1, two: 2 }
|
|
125
|
+
* }).catch(err => {
|
|
126
|
+
* console.log(err);
|
|
127
|
+
* });
|
|
128
|
+
*
|
|
129
|
+
* //Using async/await
|
|
130
|
+
* async () => {
|
|
131
|
+
* try {
|
|
132
|
+
* let results = await async.parallel([
|
|
133
|
+
* function(callback) {
|
|
134
|
+
* setTimeout(function() {
|
|
135
|
+
* callback(null, 'one');
|
|
136
|
+
* }, 200);
|
|
137
|
+
* },
|
|
138
|
+
* function(callback) {
|
|
139
|
+
* setTimeout(function() {
|
|
140
|
+
* callback(null, 'two');
|
|
141
|
+
* }, 100);
|
|
142
|
+
* }
|
|
143
|
+
* ]);
|
|
144
|
+
* console.log(results);
|
|
145
|
+
* // results is equal to ['one','two'] even though
|
|
146
|
+
* // the second function had a shorter timeout.
|
|
147
|
+
* }
|
|
148
|
+
* catch (err) {
|
|
149
|
+
* console.log(err);
|
|
150
|
+
* }
|
|
151
|
+
* }
|
|
152
|
+
*
|
|
153
|
+
* // an example using an object instead of an array
|
|
154
|
+
* async () => {
|
|
155
|
+
* try {
|
|
156
|
+
* let results = await async.parallel({
|
|
157
|
+
* one: function(callback) {
|
|
158
|
+
* setTimeout(function() {
|
|
159
|
+
* callback(null, 1);
|
|
160
|
+
* }, 200);
|
|
161
|
+
* },
|
|
162
|
+
* two: function(callback) {
|
|
163
|
+
* setTimeout(function() {
|
|
164
|
+
* callback(null, 2);
|
|
165
|
+
* }, 100);
|
|
166
|
+
* }
|
|
167
|
+
* });
|
|
168
|
+
* console.log(results);
|
|
169
|
+
* // results is equal to: { one: 1, two: 2 }
|
|
170
|
+
* }
|
|
171
|
+
* catch (err) {
|
|
172
|
+
* console.log(err);
|
|
173
|
+
* }
|
|
174
|
+
* }
|
|
175
|
+
*
|
|
87
176
|
*/
|
|
88
177
|
function parallel(tasks, callback) {
|
|
89
178
|
return (0, _parallel3.default)(_eachOf2.default, tasks, callback);
|
|
@@ -5,11 +5,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = parallelLimit;
|
|
7
7
|
|
|
8
|
-
var _eachOfLimit = require('./internal/eachOfLimit');
|
|
8
|
+
var _eachOfLimit = require('./internal/eachOfLimit.js');
|
|
9
9
|
|
|
10
10
|
var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit);
|
|
11
11
|
|
|
12
|
-
var _parallel = require('./internal/parallel');
|
|
12
|
+
var _parallel = require('./internal/parallel.js');
|
|
13
13
|
|
|
14
14
|
var _parallel2 = _interopRequireDefault(_parallel);
|
|
15
15
|
|
|
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = function (worker, concurrency) {
|
|
8
8
|
// Start with a normal queue
|
|
9
9
|
var q = (0, _queue2.default)(worker, concurrency);
|
|
10
|
+
var processingScheduled = false;
|
|
10
11
|
|
|
11
12
|
q._tasks = new _Heap2.default();
|
|
12
13
|
|
|
@@ -34,7 +35,13 @@ exports.default = function (worker, concurrency) {
|
|
|
34
35
|
q._tasks.push(item);
|
|
35
36
|
}
|
|
36
37
|
|
|
37
|
-
|
|
38
|
+
if (!processingScheduled) {
|
|
39
|
+
processingScheduled = true;
|
|
40
|
+
(0, _setImmediate2.default)(() => {
|
|
41
|
+
processingScheduled = false;
|
|
42
|
+
q.process();
|
|
43
|
+
});
|
|
44
|
+
}
|
|
38
45
|
};
|
|
39
46
|
|
|
40
47
|
// Remove unshift function
|
|
@@ -43,15 +50,15 @@ exports.default = function (worker, concurrency) {
|
|
|
43
50
|
return q;
|
|
44
51
|
};
|
|
45
52
|
|
|
46
|
-
var _setImmediate = require('./setImmediate');
|
|
53
|
+
var _setImmediate = require('./setImmediate.js');
|
|
47
54
|
|
|
48
55
|
var _setImmediate2 = _interopRequireDefault(_setImmediate);
|
|
49
56
|
|
|
50
|
-
var _queue = require('./queue');
|
|
57
|
+
var _queue = require('./queue.js');
|
|
51
58
|
|
|
52
59
|
var _queue2 = _interopRequireDefault(_queue);
|
|
53
60
|
|
|
54
|
-
var _Heap = require('./internal/Heap');
|
|
61
|
+
var _Heap = require('./internal/Heap.js');
|
|
55
62
|
|
|
56
63
|
var _Heap2 = _interopRequireDefault(_Heap);
|
|
57
64
|
|