snyk 1.842.0 → 1.843.0
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/dist/cli/index.js +32 -10
- package/dist/cli/index.js.map +1 -1
- package/package.json +2 -2
package/dist/cli/index.js
CHANGED
|
@@ -27927,16 +27927,38 @@ function add(key, value) {
|
|
|
27927
27927
|
value = strip_ansi_1.default(value);
|
|
27928
27928
|
}
|
|
27929
27929
|
if (metadata[key]) {
|
|
27930
|
-
|
|
27931
|
-
|
|
27932
|
-
|
|
27933
|
-
|
|
27934
|
-
|
|
27935
|
-
|
|
27936
|
-
|
|
27937
|
-
|
|
27938
|
-
|
|
27939
|
-
|
|
27930
|
+
switch (key) {
|
|
27931
|
+
case 'iac-metrics':
|
|
27932
|
+
break;
|
|
27933
|
+
case 'iac-type':
|
|
27934
|
+
if (typeof value === 'object') {
|
|
27935
|
+
for (const type in value) {
|
|
27936
|
+
if (metadata[key][type]) {
|
|
27937
|
+
for (const metric in value[type]) {
|
|
27938
|
+
metadata[key][type][metric] &&
|
|
27939
|
+
typeof value[type][metric] === 'number'
|
|
27940
|
+
? (metadata[key][type][metric] += value[type][metric])
|
|
27941
|
+
: (metadata[key][type][metric] = value[type][metric]);
|
|
27942
|
+
}
|
|
27943
|
+
}
|
|
27944
|
+
else {
|
|
27945
|
+
metadata[key][type] = value[type];
|
|
27946
|
+
}
|
|
27947
|
+
}
|
|
27948
|
+
}
|
|
27949
|
+
break;
|
|
27950
|
+
default:
|
|
27951
|
+
if (typeof value === 'number' && typeof metadata[key] === 'number') {
|
|
27952
|
+
metadata[key] += value;
|
|
27953
|
+
}
|
|
27954
|
+
else {
|
|
27955
|
+
if (!Array.isArray(metadata[key])) {
|
|
27956
|
+
metadata[key] = [metadata[key]];
|
|
27957
|
+
}
|
|
27958
|
+
Array.isArray(value)
|
|
27959
|
+
? metadata[key].push(...value)
|
|
27960
|
+
: metadata[key].push(value);
|
|
27961
|
+
}
|
|
27940
27962
|
}
|
|
27941
27963
|
}
|
|
27942
27964
|
else {
|