@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
@@ -5,19 +5,19 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = transform;
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 _once = require('./internal/once');
12
+ var _once = require('./internal/once.js');
13
13
 
14
14
  var _once2 = _interopRequireDefault(_once);
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
 
20
- var _promiseCallback = require('./internal/promiseCallback');
20
+ var _promiseCallback = require('./internal/promiseCallback.js');
21
21
 
22
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
23
23
 
@@ -43,26 +43,118 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
43
43
  * @returns {Promise} a promise, if no callback provided
44
44
  * @example
45
45
  *
46
- * async.transform([1,2,3], function(acc, item, index, callback) {
47
- * // pointless async:
48
- * process.nextTick(function() {
49
- * acc[index] = item * 2
50
- * callback(null)
46
+ * // file1.txt is a file that is 1000 bytes in size
47
+ * // file2.txt is a file that is 2000 bytes in size
48
+ * // file3.txt is a file that is 3000 bytes in size
49
+ *
50
+ * // helper function that returns human-readable size format from bytes
51
+ * function formatBytes(bytes, decimals = 2) {
52
+ * // implementation not included for brevity
53
+ * return humanReadbleFilesize;
54
+ * }
55
+ *
56
+ * const fileList = ['file1.txt','file2.txt','file3.txt'];
57
+ *
58
+ * // asynchronous function that returns the file size, transformed to human-readable format
59
+ * // e.g. 1024 bytes = 1KB, 1234 bytes = 1.21 KB, 1048576 bytes = 1MB, etc.
60
+ * function transformFileSize(acc, value, key, callback) {
61
+ * fs.stat(value, function(err, stat) {
62
+ * if (err) {
63
+ * return callback(err);
64
+ * }
65
+ * acc[key] = formatBytes(stat.size);
66
+ * callback(null);
51
67
  * });
52
- * }, function(err, result) {
53
- * // result is now equal to [2, 4, 6]
68
+ * }
69
+ *
70
+ * // Using callbacks
71
+ * async.transform(fileList, transformFileSize, function(err, result) {
72
+ * if(err) {
73
+ * console.log(err);
74
+ * } else {
75
+ * console.log(result);
76
+ * // [ '1000 Bytes', '1.95 KB', '2.93 KB' ]
77
+ * }
54
78
  * });
55
79
  *
80
+ * // Using Promises
81
+ * async.transform(fileList, transformFileSize)
82
+ * .then(result => {
83
+ * console.log(result);
84
+ * // [ '1000 Bytes', '1.95 KB', '2.93 KB' ]
85
+ * }).catch(err => {
86
+ * console.log(err);
87
+ * });
88
+ *
89
+ * // Using async/await
90
+ * (async () => {
91
+ * try {
92
+ * let result = await async.transform(fileList, transformFileSize);
93
+ * console.log(result);
94
+ * // [ '1000 Bytes', '1.95 KB', '2.93 KB' ]
95
+ * }
96
+ * catch (err) {
97
+ * console.log(err);
98
+ * }
99
+ * })();
100
+ *
56
101
  * @example
57
102
  *
58
- * async.transform({a: 1, b: 2, c: 3}, function (obj, val, key, callback) {
59
- * setImmediate(function () {
60
- * obj[key] = val * 2;
61
- * callback();
62
- * })
63
- * }, function (err, result) {
64
- * // result is equal to {a: 2, b: 4, c: 6}
65
- * })
103
+ * // file1.txt is a file that is 1000 bytes in size
104
+ * // file2.txt is a file that is 2000 bytes in size
105
+ * // file3.txt is a file that is 3000 bytes in size
106
+ *
107
+ * // helper function that returns human-readable size format from bytes
108
+ * function formatBytes(bytes, decimals = 2) {
109
+ * // implementation not included for brevity
110
+ * return humanReadbleFilesize;
111
+ * }
112
+ *
113
+ * const fileMap = { f1: 'file1.txt', f2: 'file2.txt', f3: 'file3.txt' };
114
+ *
115
+ * // asynchronous function that returns the file size, transformed to human-readable format
116
+ * // e.g. 1024 bytes = 1KB, 1234 bytes = 1.21 KB, 1048576 bytes = 1MB, etc.
117
+ * function transformFileSize(acc, value, key, callback) {
118
+ * fs.stat(value, function(err, stat) {
119
+ * if (err) {
120
+ * return callback(err);
121
+ * }
122
+ * acc[key] = formatBytes(stat.size);
123
+ * callback(null);
124
+ * });
125
+ * }
126
+ *
127
+ * // Using callbacks
128
+ * async.transform(fileMap, transformFileSize, function(err, result) {
129
+ * if(err) {
130
+ * console.log(err);
131
+ * } else {
132
+ * console.log(result);
133
+ * // { f1: '1000 Bytes', f2: '1.95 KB', f3: '2.93 KB' }
134
+ * }
135
+ * });
136
+ *
137
+ * // Using Promises
138
+ * async.transform(fileMap, transformFileSize)
139
+ * .then(result => {
140
+ * console.log(result);
141
+ * // { f1: '1000 Bytes', f2: '1.95 KB', f3: '2.93 KB' }
142
+ * }).catch(err => {
143
+ * console.log(err);
144
+ * });
145
+ *
146
+ * // Using async/await
147
+ * async () => {
148
+ * try {
149
+ * let result = await async.transform(fileMap, transformFileSize);
150
+ * console.log(result);
151
+ * // { f1: '1000 Bytes', f2: '1.95 KB', f3: '2.93 KB' }
152
+ * }
153
+ * catch (err) {
154
+ * console.log(err);
155
+ * }
156
+ * }
157
+ *
66
158
  */
67
159
  function transform(coll, accumulator, iteratee, callback) {
68
160
  if (arguments.length <= 3 && typeof accumulator === 'function') {
@@ -4,15 +4,15 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
 
7
- var _eachSeries = require('./eachSeries');
7
+ var _eachSeries = require('./eachSeries.js');
8
8
 
9
9
  var _eachSeries2 = _interopRequireDefault(_eachSeries);
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,11 +5,11 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = until;
7
7
 
8
- var _whilst = require('./whilst');
8
+ var _whilst = require('./whilst.js');
9
9
 
10
10
  var _whilst2 = _interopRequireDefault(_whilst);
11
11
 
12
- var _wrapAsync = require('./internal/wrapAsync');
12
+ var _wrapAsync = require('./internal/wrapAsync.js');
13
13
 
14
14
  var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
15
15
 
@@ -41,7 +41,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
41
41
  * @example
42
42
  * const results = []
43
43
  * let finished = false
44
- * async.until(function test(page, cb) {
44
+ * async.until(function test(cb) {
45
45
  * cb(null, finished)
46
46
  * }, function iter(next) {
47
47
  * fetchPage(url, (err, body) => {
@@ -4,19 +4,19 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
 
7
- var _once = require('./internal/once');
7
+ var _once = require('./internal/once.js');
8
8
 
9
9
  var _once2 = _interopRequireDefault(_once);
10
10
 
11
- var _onlyOnce = require('./internal/onlyOnce');
11
+ var _onlyOnce = require('./internal/onlyOnce.js');
12
12
 
13
13
  var _onlyOnce2 = _interopRequireDefault(_onlyOnce);
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
 
@@ -4,15 +4,15 @@ 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 _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,15 +5,15 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = asyncify;
7
7
 
8
- var _initialParams = require('./internal/initialParams');
8
+ var _initialParams = require('./internal/initialParams.js');
9
9
 
10
10
  var _initialParams2 = _interopRequireDefault(_initialParams);
11
11
 
12
- var _setImmediate = require('./internal/setImmediate');
12
+ var _setImmediate = require('./internal/setImmediate.js');
13
13
 
14
14
  var _setImmediate2 = _interopRequireDefault(_setImmediate);
15
15
 
16
- var _wrapAsync = require('./internal/wrapAsync');
16
+ var _wrapAsync = require('./internal/wrapAsync.js');
17
17
 
18
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
19
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contrast/agent",
3
- "version": "4.16.1",
3
+ "version": "4.16.2",
4
4
  "description": "Node.js security instrumentation by Contrast Security",
5
5
  "keywords": [
6
6
  "security",