snyk 1.810.0 → 1.811.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/917.index.js
CHANGED
|
@@ -2689,7 +2689,7 @@ exports.displayResult = displayResult;
|
|
|
2689
2689
|
"use strict";
|
|
2690
2690
|
|
|
2691
2691
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2692
|
-
exports.groupVulnerabilities = exports.dockerUserCTA = exports.getDisplayedOutput = exports.createErrorMappedResultsForJsonOutput = exports.extractDataToSendFromResults = exports.
|
|
2692
|
+
exports.groupVulnerabilities = exports.dockerUserCTA = exports.getDisplayedOutput = exports.createErrorMappedResultsForJsonOutput = exports.extractDataToSendFromResults = exports.formatJsonVulnerabilityStructure = void 0;
|
|
2693
2693
|
const format_reachability_1 = __webpack_require__(13331);
|
|
2694
2694
|
const chalk_1 = __webpack_require__(32589);
|
|
2695
2695
|
const config_1 = __webpack_require__(22541);
|
|
@@ -2707,7 +2707,7 @@ const open_source_sarif_output_1 = __webpack_require__(9401);
|
|
|
2707
2707
|
const get_severity_value_1 = __webpack_require__(24898);
|
|
2708
2708
|
const show_fix_tip_1 = __webpack_require__(30417);
|
|
2709
2709
|
const dist_1 = __webpack_require__(61165);
|
|
2710
|
-
function
|
|
2710
|
+
function formatJsonVulnerabilityStructure(jsonData, options) {
|
|
2711
2711
|
const jsonDataClone = cloneDeep(jsonData);
|
|
2712
2712
|
if (options['group-issues']) {
|
|
2713
2713
|
jsonDataClone.vulnerabilities = Object.values((jsonDataClone.vulnerabilities || []).reduce((acc, vuln) => {
|
|
@@ -2727,7 +2727,7 @@ function formatJsonOutput(jsonData, options) {
|
|
|
2727
2727
|
}
|
|
2728
2728
|
return jsonDataClone;
|
|
2729
2729
|
}
|
|
2730
|
-
exports.
|
|
2730
|
+
exports.formatJsonVulnerabilityStructure = formatJsonVulnerabilityStructure;
|
|
2731
2731
|
function extractDataToSendFromResults(results, jsonData, options) {
|
|
2732
2732
|
let sarifData = {};
|
|
2733
2733
|
let stringifiedSarifData = '';
|
|
@@ -2745,12 +2745,12 @@ function extractDataToSendFromResults(results, jsonData, options) {
|
|
|
2745
2745
|
}
|
|
2746
2746
|
let stringifiedJsonData = '';
|
|
2747
2747
|
if (options.json || options['json-file-output']) {
|
|
2748
|
-
if (Array.isArray(jsonData)
|
|
2749
|
-
const jsonResult = jsonData.map((res) =>
|
|
2748
|
+
if (Array.isArray(jsonData)) {
|
|
2749
|
+
const jsonResult = jsonData.map((res) => formatJsonVulnerabilityStructure(res, options));
|
|
2750
2750
|
stringifiedJsonData = json_1.jsonStringifyLargeObject(jsonResult);
|
|
2751
2751
|
}
|
|
2752
2752
|
else {
|
|
2753
|
-
stringifiedJsonData = json_1.jsonStringifyLargeObject(
|
|
2753
|
+
stringifiedJsonData = json_1.jsonStringifyLargeObject(formatJsonVulnerabilityStructure(jsonData, options));
|
|
2754
2754
|
}
|
|
2755
2755
|
}
|
|
2756
2756
|
const dataToSend = options.sarif ? sarifData : jsonData;
|