@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.
Files changed (124) hide show
  1. package/bin/VERSION +1 -1
  2. package/bin/linux/contrast-service +0 -0
  3. package/bin/mac/contrast-service +0 -0
  4. package/bin/windows/contrast-service.exe +0 -0
  5. package/lib/protect/rules/cmd-injection/cmdinjection-rule.js +1 -1
  6. package/node_modules/async/CHANGELOG.md +13 -0
  7. package/node_modules/async/all.js +74 -9
  8. package/node_modules/async/allLimit.js +3 -3
  9. package/node_modules/async/allSeries.js +3 -3
  10. package/node_modules/async/any.js +75 -9
  11. package/node_modules/async/anyLimit.js +3 -3
  12. package/node_modules/async/anySeries.js +3 -3
  13. package/node_modules/async/applyEach.js +2 -2
  14. package/node_modules/async/applyEachSeries.js +2 -2
  15. package/node_modules/async/asyncify.js +3 -3
  16. package/node_modules/async/auto.js +81 -15
  17. package/node_modules/async/autoInject.js +30 -4
  18. package/node_modules/async/cargo.js +1 -1
  19. package/node_modules/async/cargoQueue.js +1 -1
  20. package/node_modules/async/compose.js +1 -1
  21. package/node_modules/async/concat.js +72 -4
  22. package/node_modules/async/concatLimit.js +3 -3
  23. package/node_modules/async/concatSeries.js +2 -2
  24. package/node_modules/async/detect.js +43 -8
  25. package/node_modules/async/detectLimit.js +3 -3
  26. package/node_modules/async/detectSeries.js +3 -3
  27. package/node_modules/async/dir.js +1 -1
  28. package/node_modules/async/dist/async.js +1379 -168
  29. package/node_modules/async/dist/async.min.js +1 -1
  30. package/node_modules/async/dist/async.mjs +1372 -161
  31. package/node_modules/async/doDuring.js +3 -3
  32. package/node_modules/async/doUntil.js +2 -2
  33. package/node_modules/async/doWhilst.js +3 -3
  34. package/node_modules/async/during.js +3 -3
  35. package/node_modules/async/each.js +69 -28
  36. package/node_modules/async/eachLimit.js +4 -4
  37. package/node_modules/async/eachOf.js +85 -16
  38. package/node_modules/async/eachOfLimit.js +3 -3
  39. package/node_modules/async/eachOfSeries.js +2 -2
  40. package/node_modules/async/eachSeries.js +2 -2
  41. package/node_modules/async/ensureAsync.js +2 -2
  42. package/node_modules/async/every.js +74 -9
  43. package/node_modules/async/everyLimit.js +3 -3
  44. package/node_modules/async/everySeries.js +3 -3
  45. package/node_modules/async/filter.js +49 -9
  46. package/node_modules/async/filterLimit.js +3 -3
  47. package/node_modules/async/filterSeries.js +3 -3
  48. package/node_modules/async/find.js +43 -8
  49. package/node_modules/async/findLimit.js +3 -3
  50. package/node_modules/async/findSeries.js +3 -3
  51. package/node_modules/async/flatMap.js +72 -4
  52. package/node_modules/async/flatMapLimit.js +3 -3
  53. package/node_modules/async/flatMapSeries.js +2 -2
  54. package/node_modules/async/foldl.js +87 -11
  55. package/node_modules/async/foldr.js +2 -2
  56. package/node_modules/async/forEach.js +69 -28
  57. package/node_modules/async/forEachLimit.js +4 -4
  58. package/node_modules/async/forEachOf.js +85 -16
  59. package/node_modules/async/forEachOfLimit.js +3 -3
  60. package/node_modules/async/forEachOfSeries.js +2 -2
  61. package/node_modules/async/forEachSeries.js +2 -2
  62. package/node_modules/async/forever.js +4 -4
  63. package/node_modules/async/groupBy.js +62 -8
  64. package/node_modules/async/groupByLimit.js +3 -3
  65. package/node_modules/async/groupBySeries.js +2 -2
  66. package/node_modules/async/inject.js +87 -11
  67. package/node_modules/async/internal/applyEach.js +2 -2
  68. package/node_modules/async/internal/asyncEachOfLimit.js +1 -1
  69. package/node_modules/async/internal/consoleFunc.js +5 -1
  70. package/node_modules/async/internal/createTester.js +2 -2
  71. package/node_modules/async/internal/eachOfLimit.js +6 -6
  72. package/node_modules/async/internal/filter.js +2 -2
  73. package/node_modules/async/internal/iterator.js +5 -2
  74. package/node_modules/async/internal/map.js +1 -1
  75. package/node_modules/async/internal/parallel.js +3 -3
  76. package/node_modules/async/internal/queue.js +4 -4
  77. package/node_modules/async/internal/reject.js +2 -2
  78. package/node_modules/async/internal/setImmediate.js +6 -2
  79. package/node_modules/async/internal/wrapAsync.js +1 -1
  80. package/node_modules/async/log.js +1 -1
  81. package/node_modules/async/map.js +86 -6
  82. package/node_modules/async/mapLimit.js +3 -3
  83. package/node_modules/async/mapSeries.js +3 -3
  84. package/node_modules/async/mapValues.js +102 -12
  85. package/node_modules/async/mapValuesLimit.js +4 -4
  86. package/node_modules/async/mapValuesSeries.js +1 -1
  87. package/node_modules/async/memoize.js +3 -3
  88. package/node_modules/async/nextTick.js +3 -3
  89. package/node_modules/async/package.json +4 -6
  90. package/node_modules/async/parallel.js +96 -7
  91. package/node_modules/async/parallelLimit.js +2 -2
  92. package/node_modules/async/priorityQueue.js +11 -4
  93. package/node_modules/async/queue.js +4 -4
  94. package/node_modules/async/race.js +3 -3
  95. package/node_modules/async/reduce.js +87 -11
  96. package/node_modules/async/reduceRight.js +2 -2
  97. package/node_modules/async/reflect.js +2 -2
  98. package/node_modules/async/reflectAll.js +1 -1
  99. package/node_modules/async/reject.js +44 -10
  100. package/node_modules/async/rejectLimit.js +3 -3
  101. package/node_modules/async/rejectSeries.js +3 -3
  102. package/node_modules/async/retry.js +2 -2
  103. package/node_modules/async/retryable.js +4 -4
  104. package/node_modules/async/select.js +49 -9
  105. package/node_modules/async/selectLimit.js +3 -3
  106. package/node_modules/async/selectSeries.js +3 -3
  107. package/node_modules/async/seq.js +4 -4
  108. package/node_modules/async/series.js +112 -12
  109. package/node_modules/async/setImmediate.js +1 -1
  110. package/node_modules/async/some.js +75 -9
  111. package/node_modules/async/someLimit.js +3 -3
  112. package/node_modules/async/someSeries.js +3 -3
  113. package/node_modules/async/sortBy.js +121 -19
  114. package/node_modules/async/timeout.js +2 -2
  115. package/node_modules/async/times.js +1 -1
  116. package/node_modules/async/timesLimit.js +3 -3
  117. package/node_modules/async/timesSeries.js +1 -1
  118. package/node_modules/async/transform.js +111 -19
  119. package/node_modules/async/tryEach.js +3 -3
  120. package/node_modules/async/until.js +3 -3
  121. package/node_modules/async/waterfall.js +4 -4
  122. package/node_modules/async/whilst.js +3 -3
  123. package/node_modules/async/wrapSync.js +3 -3
  124. package/package.json +1 -1
@@ -4,31 +4,31 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
 
7
- var _isArrayLike = require('./internal/isArrayLike');
7
+ var _isArrayLike = require('./internal/isArrayLike.js');
8
8
 
9
9
  var _isArrayLike2 = _interopRequireDefault(_isArrayLike);
10
10
 
11
- var _breakLoop = require('./internal/breakLoop');
11
+ var _breakLoop = require('./internal/breakLoop.js');
12
12
 
13
13
  var _breakLoop2 = _interopRequireDefault(_breakLoop);
14
14
 
15
- var _eachOfLimit = require('./eachOfLimit');
15
+ var _eachOfLimit = require('./eachOfLimit.js');
16
16
 
17
17
  var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit);
18
18
 
19
- var _once = require('./internal/once');
19
+ var _once = require('./internal/once.js');
20
20
 
21
21
  var _once2 = _interopRequireDefault(_once);
22
22
 
23
- var _onlyOnce = require('./internal/onlyOnce');
23
+ var _onlyOnce = require('./internal/onlyOnce.js');
24
24
 
25
25
  var _onlyOnce2 = _interopRequireDefault(_onlyOnce);
26
26
 
27
- var _wrapAsync = require('./internal/wrapAsync');
27
+ var _wrapAsync = require('./internal/wrapAsync.js');
28
28
 
29
29
  var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
30
30
 
31
- var _awaitify = require('./internal/awaitify');
31
+ var _awaitify = require('./internal/awaitify.js');
32
32
 
33
33
  var _awaitify2 = _interopRequireDefault(_awaitify);
34
34
 
@@ -88,12 +88,19 @@ function eachOfGeneric(coll, iteratee, callback) {
88
88
  * @returns {Promise} a promise, if a callback is omitted
89
89
  * @example
90
90
  *
91
- * var obj = {dev: "/dev.json", test: "/test.json", prod: "/prod.json"};
92
- * var configs = {};
91
+ * // dev.json is a file containing a valid json object config for dev environment
92
+ * // dev.json is a file containing a valid json object config for test environment
93
+ * // prod.json is a file containing a valid json object config for prod environment
94
+ * // invalid.json is a file with a malformed json object
93
95
  *
94
- * async.forEachOf(obj, function (value, key, callback) {
95
- * fs.readFile(__dirname + value, "utf8", function (err, data) {
96
- * if (err) return callback(err);
96
+ * let configs = {}; //global variable
97
+ * let validConfigFileMap = {dev: 'dev.json', test: 'test.json', prod: 'prod.json'};
98
+ * let invalidConfigFileMap = {dev: 'dev.json', test: 'test.json', invalid: 'invalid.json'};
99
+ *
100
+ * // asynchronous function that reads a json file and parses the contents as json object
101
+ * function parseFile(file, key, callback) {
102
+ * fs.readFile(file, "utf8", function(err, data) {
103
+ * if (err) return calback(err);
97
104
  * try {
98
105
  * configs[key] = JSON.parse(data);
99
106
  * } catch (e) {
@@ -101,11 +108,73 @@ function eachOfGeneric(coll, iteratee, callback) {
101
108
  * }
102
109
  * callback();
103
110
  * });
104
- * }, function (err) {
105
- * if (err) console.error(err.message);
106
- * // configs is now a map of JSON data
107
- * doSomethingWith(configs);
111
+ * }
112
+ *
113
+ * // Using callbacks
114
+ * async.forEachOf(validConfigFileMap, parseFile, function (err) {
115
+ * if (err) {
116
+ * console.error(err);
117
+ * } else {
118
+ * console.log(configs);
119
+ * // configs is now a map of JSON data, e.g.
120
+ * // { dev: //parsed dev.json, test: //parsed test.json, prod: //parsed prod.json}
121
+ * }
122
+ * });
123
+ *
124
+ * //Error handing
125
+ * async.forEachOf(invalidConfigFileMap, parseFile, function (err) {
126
+ * if (err) {
127
+ * console.error(err);
128
+ * // JSON parse error exception
129
+ * } else {
130
+ * console.log(configs);
131
+ * }
132
+ * });
133
+ *
134
+ * // Using Promises
135
+ * async.forEachOf(validConfigFileMap, parseFile)
136
+ * .then( () => {
137
+ * console.log(configs);
138
+ * // configs is now a map of JSON data, e.g.
139
+ * // { dev: //parsed dev.json, test: //parsed test.json, prod: //parsed prod.json}
140
+ * }).catch( err => {
141
+ * console.error(err);
108
142
  * });
143
+ *
144
+ * //Error handing
145
+ * async.forEachOf(invalidConfigFileMap, parseFile)
146
+ * .then( () => {
147
+ * console.log(configs);
148
+ * }).catch( err => {
149
+ * console.error(err);
150
+ * // JSON parse error exception
151
+ * });
152
+ *
153
+ * // Using async/await
154
+ * async () => {
155
+ * try {
156
+ * let result = await async.forEachOf(validConfigFileMap, parseFile);
157
+ * console.log(configs);
158
+ * // configs is now a map of JSON data, e.g.
159
+ * // { dev: //parsed dev.json, test: //parsed test.json, prod: //parsed prod.json}
160
+ * }
161
+ * catch (err) {
162
+ * console.log(err);
163
+ * }
164
+ * }
165
+ *
166
+ * //Error handing
167
+ * async () => {
168
+ * try {
169
+ * let result = await async.forEachOf(invalidConfigFileMap, parseFile);
170
+ * console.log(configs);
171
+ * }
172
+ * catch (err) {
173
+ * console.log(err);
174
+ * // JSON parse error exception
175
+ * }
176
+ * }
177
+ *
109
178
  */
110
179
  function eachOf(coll, iteratee, callback) {
111
180
  var eachOfImplementation = (0, _isArrayLike2.default)(coll) ? eachOfArrayLike : eachOfGeneric;
@@ -4,15 +4,15 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
 
7
- var _eachOfLimit2 = require('./internal/eachOfLimit');
7
+ var _eachOfLimit2 = require('./internal/eachOfLimit.js');
8
8
 
9
9
  var _eachOfLimit3 = _interopRequireDefault(_eachOfLimit2);
10
10
 
11
- var _wrapAsync = require('./internal/wrapAsync');
11
+ var _wrapAsync = require('./internal/wrapAsync.js');
12
12
 
13
13
  var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
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,11 +4,11 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
 
7
- var _eachOfLimit = require('./eachOfLimit');
7
+ var _eachOfLimit = require('./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
 
@@ -4,11 +4,11 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
 
7
- var _eachLimit = require('./eachLimit');
7
+ var _eachLimit = require('./eachLimit.js');
8
8
 
9
9
  var _eachLimit2 = _interopRequireDefault(_eachLimit);
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
 
@@ -4,19 +4,19 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
 
7
- var _onlyOnce = require('./internal/onlyOnce');
7
+ var _onlyOnce = require('./internal/onlyOnce.js');
8
8
 
9
9
  var _onlyOnce2 = _interopRequireDefault(_onlyOnce);
10
10
 
11
- var _ensureAsync = require('./ensureAsync');
11
+ var _ensureAsync = require('./ensureAsync.js');
12
12
 
13
13
  var _ensureAsync2 = _interopRequireDefault(_ensureAsync);
14
14
 
15
- var _wrapAsync = require('./internal/wrapAsync');
15
+ var _wrapAsync = require('./internal/wrapAsync.js');
16
16
 
17
17
  var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
18
18
 
19
- var _awaitify = require('./internal/awaitify');
19
+ var _awaitify = require('./internal/awaitify.js');
20
20
 
21
21
  var _awaitify2 = _interopRequireDefault(_awaitify);
22
22
 
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = groupBy;
7
7
 
8
- var _groupByLimit = require('./groupByLimit');
8
+ var _groupByLimit = require('./groupByLimit.js');
9
9
 
10
10
  var _groupByLimit2 = _interopRequireDefault(_groupByLimit);
11
11
 
@@ -38,15 +38,69 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
38
38
  * @returns {Promise} a promise, if no callback is passed
39
39
  * @example
40
40
  *
41
- * async.groupBy(['userId1', 'userId2', 'userId3'], function(userId, callback) {
42
- * db.findById(userId, function(err, user) {
43
- * if (err) return callback(err);
44
- * return callback(null, user.age);
41
+ * // dir1 is a directory that contains file1.txt, file2.txt
42
+ * // dir2 is a directory that contains file3.txt, file4.txt
43
+ * // dir3 is a directory that contains file5.txt
44
+ * // dir4 does not exist
45
+ *
46
+ * const files = ['dir1/file1.txt','dir2','dir4']
47
+ *
48
+ * // asynchronous function that detects file type as none, file, or directory
49
+ * function detectFile(file, callback) {
50
+ * fs.stat(file, function(err, stat) {
51
+ * if (err) {
52
+ * return callback(null, 'none');
53
+ * }
54
+ * callback(null, stat.isDirectory() ? 'directory' : 'file');
45
55
  * });
46
- * }, function(err, result) {
47
- * // result is object containing the userIds grouped by age
48
- * // e.g. { 30: ['userId1', 'userId3'], 42: ['userId2']};
56
+ * }
57
+ *
58
+ * //Using callbacks
59
+ * async.groupBy(files, detectFile, function(err, result) {
60
+ * if(err) {
61
+ * console.log(err);
62
+ * } else {
63
+ * console.log(result);
64
+ * // {
65
+ * // file: [ 'dir1/file1.txt' ],
66
+ * // none: [ 'dir4' ],
67
+ * // directory: [ 'dir2']
68
+ * // }
69
+ * // result is object containing the files grouped by type
70
+ * }
49
71
  * });
72
+ *
73
+ * // Using Promises
74
+ * async.groupBy(files, detectFile)
75
+ * .then( result => {
76
+ * console.log(result);
77
+ * // {
78
+ * // file: [ 'dir1/file1.txt' ],
79
+ * // none: [ 'dir4' ],
80
+ * // directory: [ 'dir2']
81
+ * // }
82
+ * // result is object containing the files grouped by type
83
+ * }).catch( err => {
84
+ * console.log(err);
85
+ * });
86
+ *
87
+ * // Using async/await
88
+ * async () => {
89
+ * try {
90
+ * let result = await async.groupBy(files, detectFile);
91
+ * console.log(result);
92
+ * // {
93
+ * // file: [ 'dir1/file1.txt' ],
94
+ * // none: [ 'dir4' ],
95
+ * // directory: [ 'dir2']
96
+ * // }
97
+ * // result is object containing the files grouped by type
98
+ * }
99
+ * catch (err) {
100
+ * console.log(err);
101
+ * }
102
+ * }
103
+ *
50
104
  */
51
105
  function groupBy(coll, iteratee, callback) {
52
106
  return (0, _groupByLimit2.default)(coll, Infinity, iteratee, callback);
@@ -4,15 +4,15 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
 
7
- var _mapLimit = require('./mapLimit');
7
+ var _mapLimit = require('./mapLimit.js');
8
8
 
9
9
  var _mapLimit2 = _interopRequireDefault(_mapLimit);
10
10
 
11
- var _wrapAsync = require('./internal/wrapAsync');
11
+ var _wrapAsync = require('./internal/wrapAsync.js');
12
12
 
13
13
  var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
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 = groupBySeries;
7
7
 
8
- var _groupByLimit = require('./groupByLimit');
8
+ var _groupByLimit = require('./groupByLimit.js');
9
9
 
10
10
  var _groupByLimit2 = _interopRequireDefault(_groupByLimit);
11
11
 
@@ -26,7 +26,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
26
26
  * The iteratee should complete with a `key` to group the value under.
27
27
  * Invoked with (value, callback).
28
28
  * @param {Function} [callback] - A callback which is called when all `iteratee`
29
- * functions have finished, or an error occurs. Result is an `Object` whoses
29
+ * functions have finished, or an error occurs. Result is an `Object` whose
30
30
  * properties are arrays of values which returned the corresponding key.
31
31
  * @returns {Promise} a promise, if no callback is passed
32
32
  */
@@ -4,19 +4,19 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
 
7
- var _eachOfSeries = require('./eachOfSeries');
7
+ var _eachOfSeries = require('./eachOfSeries.js');
8
8
 
9
9
  var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries);
10
10
 
11
- var _once = require('./internal/once');
11
+ var _once = require('./internal/once.js');
12
12
 
13
13
  var _once2 = _interopRequireDefault(_once);
14
14
 
15
- var _wrapAsync = require('./internal/wrapAsync');
15
+ var _wrapAsync = require('./internal/wrapAsync.js');
16
16
 
17
17
  var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
18
18
 
19
- var _awaitify = require('./internal/awaitify');
19
+ var _awaitify = require('./internal/awaitify.js');
20
20
 
21
21
  var _awaitify2 = _interopRequireDefault(_awaitify);
22
22
 
@@ -45,7 +45,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
45
45
  * @param {AsyncFunction} iteratee - A function applied to each item in the
46
46
  * array to produce the next step in the reduction.
47
47
  * The `iteratee` should complete with the next state of the reduction.
48
- * If the iteratee complete with an error, the reduction is stopped and the
48
+ * If the iteratee completes with an error, the reduction is stopped and the
49
49
  * main `callback` is immediately called with the error.
50
50
  * Invoked with (memo, item, callback).
51
51
  * @param {Function} [callback] - A callback which is called after all the
@@ -54,14 +54,90 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
54
54
  * @returns {Promise} a promise, if no callback is passed
55
55
  * @example
56
56
  *
57
- * async.reduce([1,2,3], 0, function(memo, item, callback) {
58
- * // pointless async:
59
- * process.nextTick(function() {
60
- * callback(null, memo + item)
57
+ * // file1.txt is a file that is 1000 bytes in size
58
+ * // file2.txt is a file that is 2000 bytes in size
59
+ * // file3.txt is a file that is 3000 bytes in size
60
+ * // file4.txt does not exist
61
+ *
62
+ * const fileList = ['file1.txt','file2.txt','file3.txt'];
63
+ * const withMissingFileList = ['file1.txt','file2.txt','file3.txt', 'file4.txt'];
64
+ *
65
+ * // asynchronous function that computes the file size in bytes
66
+ * // file size is added to the memoized value, then returned
67
+ * function getFileSizeInBytes(memo, file, callback) {
68
+ * fs.stat(file, function(err, stat) {
69
+ * if (err) {
70
+ * return callback(err);
71
+ * }
72
+ * callback(null, memo + stat.size);
61
73
  * });
62
- * }, function(err, result) {
63
- * // result is now equal to the last value of memo, which is 6
74
+ * }
75
+ *
76
+ * // Using callbacks
77
+ * async.reduce(fileList, 0, getFileSizeInBytes, function(err, result) {
78
+ * if (err) {
79
+ * console.log(err);
80
+ * } else {
81
+ * console.log(result);
82
+ * // 6000
83
+ * // which is the sum of the file sizes of the three files
84
+ * }
85
+ * });
86
+ *
87
+ * // Error Handling
88
+ * async.reduce(withMissingFileList, 0, getFileSizeInBytes, function(err, result) {
89
+ * if (err) {
90
+ * console.log(err);
91
+ * // [ Error: ENOENT: no such file or directory ]
92
+ * } else {
93
+ * console.log(result);
94
+ * }
95
+ * });
96
+ *
97
+ * // Using Promises
98
+ * async.reduce(fileList, 0, getFileSizeInBytes)
99
+ * .then( result => {
100
+ * console.log(result);
101
+ * // 6000
102
+ * // which is the sum of the file sizes of the three files
103
+ * }).catch( err => {
104
+ * console.log(err);
105
+ * });
106
+ *
107
+ * // Error Handling
108
+ * async.reduce(withMissingFileList, 0, getFileSizeInBytes)
109
+ * .then( result => {
110
+ * console.log(result);
111
+ * }).catch( err => {
112
+ * console.log(err);
113
+ * // [ Error: ENOENT: no such file or directory ]
64
114
  * });
115
+ *
116
+ * // Using async/await
117
+ * async () => {
118
+ * try {
119
+ * let result = await async.reduce(fileList, 0, getFileSizeInBytes);
120
+ * console.log(result);
121
+ * // 6000
122
+ * // which is the sum of the file sizes of the three files
123
+ * }
124
+ * catch (err) {
125
+ * console.log(err);
126
+ * }
127
+ * }
128
+ *
129
+ * // Error Handling
130
+ * async () => {
131
+ * try {
132
+ * let result = await async.reduce(withMissingFileList, 0, getFileSizeInBytes);
133
+ * console.log(result);
134
+ * }
135
+ * catch (err) {
136
+ * console.log(err);
137
+ * // [ Error: ENOENT: no such file or directory ]
138
+ * }
139
+ * }
140
+ *
65
141
  */
66
142
  function reduce(coll, memo, iteratee, callback) {
67
143
  callback = (0, _once2.default)(callback);
@@ -16,11 +16,11 @@ exports.default = function (eachfn) {
16
16
  };
17
17
  };
18
18
 
19
- var _wrapAsync = require('./wrapAsync');
19
+ var _wrapAsync = require('./wrapAsync.js');
20
20
 
21
21
  var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
22
22
 
23
- var _awaitify = require('./awaitify');
23
+ var _awaitify = require('./awaitify.js');
24
24
 
25
25
  var _awaitify2 = _interopRequireDefault(_awaitify);
26
26
 
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = asyncEachOfLimit;
7
7
 
8
- var _breakLoop = require('./breakLoop');
8
+ var _breakLoop = require('./breakLoop.js');
9
9
 
10
10
  var _breakLoop2 = _interopRequireDefault(_breakLoop);
11
11
 
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = consoleFunc;
7
7
 
8
- var _wrapAsync = require('./wrapAsync');
8
+ var _wrapAsync = require('./wrapAsync.js');
9
9
 
10
10
  var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
11
11
 
@@ -13,12 +13,16 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
13
13
 
14
14
  function consoleFunc(name) {
15
15
  return (fn, ...args) => (0, _wrapAsync2.default)(fn)(...args, (err, ...resultArgs) => {
16
+ /* istanbul ignore else */
16
17
  if (typeof console === 'object') {
18
+ /* istanbul ignore else */
17
19
  if (err) {
20
+ /* istanbul ignore else */
18
21
  if (console.error) {
19
22
  console.error(err);
20
23
  }
21
24
  } else if (console[name]) {
25
+ /* istanbul ignore else */
22
26
  resultArgs.forEach(x => console[name](x));
23
27
  }
24
28
  }
@@ -5,11 +5,11 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = _createTester;
7
7
 
8
- var _breakLoop = require('./breakLoop');
8
+ var _breakLoop = require('./breakLoop.js');
9
9
 
10
10
  var _breakLoop2 = _interopRequireDefault(_breakLoop);
11
11
 
12
- var _wrapAsync = require('./wrapAsync');
12
+ var _wrapAsync = require('./wrapAsync.js');
13
13
 
14
14
  var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
15
15
 
@@ -4,25 +4,25 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
 
7
- var _once = require('./once');
7
+ var _once = require('./once.js');
8
8
 
9
9
  var _once2 = _interopRequireDefault(_once);
10
10
 
11
- var _iterator = require('./iterator');
11
+ var _iterator = require('./iterator.js');
12
12
 
13
13
  var _iterator2 = _interopRequireDefault(_iterator);
14
14
 
15
- var _onlyOnce = require('./onlyOnce');
15
+ var _onlyOnce = require('./onlyOnce.js');
16
16
 
17
17
  var _onlyOnce2 = _interopRequireDefault(_onlyOnce);
18
18
 
19
- var _wrapAsync = require('./wrapAsync');
19
+ var _wrapAsync = require('./wrapAsync.js');
20
20
 
21
- var _asyncEachOfLimit = require('./asyncEachOfLimit');
21
+ var _asyncEachOfLimit = require('./asyncEachOfLimit.js');
22
22
 
23
23
  var _asyncEachOfLimit2 = _interopRequireDefault(_asyncEachOfLimit);
24
24
 
25
- var _breakLoop = require('./breakLoop');
25
+ var _breakLoop = require('./breakLoop.js');
26
26
 
27
27
  var _breakLoop2 = _interopRequireDefault(_breakLoop);
28
28
 
@@ -5,11 +5,11 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = _filter;
7
7
 
8
- var _isArrayLike = require('./isArrayLike');
8
+ var _isArrayLike = require('./isArrayLike.js');
9
9
 
10
10
  var _isArrayLike2 = _interopRequireDefault(_isArrayLike);
11
11
 
12
- var _wrapAsync = require('./wrapAsync');
12
+ var _wrapAsync = require('./wrapAsync.js');
13
13
 
14
14
  var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
15
15
 
@@ -5,11 +5,11 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = createIterator;
7
7
 
8
- var _isArrayLike = require('./isArrayLike');
8
+ var _isArrayLike = require('./isArrayLike.js');
9
9
 
10
10
  var _isArrayLike2 = _interopRequireDefault(_isArrayLike);
11
11
 
12
- var _getIterator = require('./getIterator');
12
+ var _getIterator = require('./getIterator.js');
13
13
 
14
14
  var _getIterator2 = _interopRequireDefault(_getIterator);
15
15
 
@@ -39,6 +39,9 @@ function createObjectIterator(obj) {
39
39
  var len = okeys.length;
40
40
  return function next() {
41
41
  var key = okeys[++i];
42
+ if (key === '__proto__') {
43
+ return next();
44
+ }
42
45
  return i < len ? { value: obj[key], key } : null;
43
46
  };
44
47
  }
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = _asyncMap;
7
7
 
8
- var _wrapAsync = require('./wrapAsync');
8
+ var _wrapAsync = require('./wrapAsync.js');
9
9
 
10
10
  var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
11
11
 
@@ -4,15 +4,15 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
 
7
- var _isArrayLike = require('./isArrayLike');
7
+ var _isArrayLike = require('./isArrayLike.js');
8
8
 
9
9
  var _isArrayLike2 = _interopRequireDefault(_isArrayLike);
10
10
 
11
- var _wrapAsync = require('./wrapAsync');
11
+ var _wrapAsync = require('./wrapAsync.js');
12
12
 
13
13
  var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
14
14
 
15
- var _awaitify = require('./awaitify');
15
+ var _awaitify = require('./awaitify.js');
16
16
 
17
17
  var _awaitify2 = _interopRequireDefault(_awaitify);
18
18
 
@@ -5,19 +5,19 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = queue;
7
7
 
8
- var _onlyOnce = require('./onlyOnce');
8
+ var _onlyOnce = require('./onlyOnce.js');
9
9
 
10
10
  var _onlyOnce2 = _interopRequireDefault(_onlyOnce);
11
11
 
12
- var _setImmediate = require('./setImmediate');
12
+ var _setImmediate = require('./setImmediate.js');
13
13
 
14
14
  var _setImmediate2 = _interopRequireDefault(_setImmediate);
15
15
 
16
- var _DoublyLinkedList = require('./DoublyLinkedList');
16
+ var _DoublyLinkedList = require('./DoublyLinkedList.js');
17
17
 
18
18
  var _DoublyLinkedList2 = _interopRequireDefault(_DoublyLinkedList);
19
19
 
20
- var _wrapAsync = require('./wrapAsync');
20
+ var _wrapAsync = require('./wrapAsync.js');
21
21
 
22
22
  var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
23
23