compact-yarn-audit
Advanced tools
Comparing version 1.0.1 to 1.1.0
{ | ||
"name": "compact-yarn-audit", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"description": "Presents output from yarn audit in a compact table", | ||
@@ -36,2 +36,3 @@ "engines": { | ||
"get-stream": "^6.0.1", | ||
"lodash.uniqby": "^4.7.0", | ||
"strip-ansi": "^7.0.0", | ||
@@ -38,0 +39,0 @@ "text-table": "^0.2.0" |
@@ -0,1 +1,3 @@ | ||
import uniqBy from "lodash.uniqby"; | ||
function auditLog2Object(pAuditLog) { | ||
@@ -12,3 +14,2 @@ return JSON.parse(`[${pAuditLog.split("\n").join(",")}]`.replace(",]", "]")); | ||
title: pLogEntry.data.advisory.title, | ||
cves: pLogEntry.data.advisory.cves.join(", "), | ||
fixable: lFixable, | ||
@@ -34,2 +35,4 @@ fixString: lFixable | ||
function unique(pTerseEntries) {} | ||
function sortEntry(pEntryLeft, pEntryRight) { | ||
@@ -41,7 +44,14 @@ return `${severity2Order(pEntryLeft.severity)}|${pEntryLeft.module_name}` > | ||
} | ||
function wholeRecordAsString(pLogEntry) { | ||
return `${pLogEntry.severity}|${pLogEntry.title}|${pLogEntry.fixString}|${pLogEntry.module_name}|${pLogEntry.via}`; | ||
} | ||
export function terseLog(pLog) { | ||
return auditLog2Object(pLog) | ||
.filter((pLogEntry) => pLogEntry.type === "auditAdvisory") | ||
.map(extractUsefulAttributesFromLogEntry) | ||
.sort(sortEntry); | ||
return uniqBy( | ||
auditLog2Object(pLog) | ||
.filter((pLogEntry) => pLogEntry.type === "auditAdvisory") | ||
.map(extractUsefulAttributesFromLogEntry) | ||
.sort(sortEntry), | ||
wholeRecordAsString | ||
); | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7140
94
5
+ Addedlodash.uniqby@^4.7.0
+ Addedlodash.uniqby@4.7.0(transitive)