compact-yarn-audit
Advanced tools
Comparing version 4.0.2 to 4.0.3
@@ -1,5 +0,1 @@ | ||
import { createHash } from "node:crypto"; | ||
function hash(pEntry) { | ||
return createHash("md5").update(JSON.stringify(pEntry)).digest("base64"); | ||
} | ||
function extractUsefulAttributes(pLogEntry) { | ||
@@ -36,5 +32,5 @@ const lFixable = pLogEntry.data.advisory.patched_versions !== "<0.0.0"; | ||
export class TerseAdvisoryLog { | ||
log = new Map(); | ||
log = new Set(); | ||
constructor() { | ||
this.log = new Map(); | ||
this.log = new Set(); | ||
} | ||
@@ -44,8 +40,10 @@ add(pEntry) { | ||
const lUsefulAttributes = extractUsefulAttributes(pEntry); | ||
this.log.set(hash(lUsefulAttributes), lUsefulAttributes); | ||
this.log.add(JSON.stringify(lUsefulAttributes)); | ||
} | ||
} | ||
get() { | ||
return [...this.log.values()].sort(orderEntry); | ||
return Array.from(this.log) | ||
.map((pStringifiedEntry) => JSON.parse(pStringifiedEntry)) | ||
.sort(orderEntry); | ||
} | ||
} |
{ | ||
"name": "compact-yarn-audit", | ||
"version": "4.0.2", | ||
"version": "4.0.3", | ||
"description": "Presents output from yarn audit in a compact table", | ||
@@ -5,0 +5,0 @@ "engines": { |
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
10471
131