Adds widget for monitoring CVE vulnerabilities

This commit is contained in:
Alicie
2021-12-26 22:56:11 +00:00
committed by Alicia Sykes
parent 6c0fb6fd41
commit 1296ca0bda
6 changed files with 417 additions and 127 deletions

View File

@@ -142,3 +142,8 @@ export const roundPrice = (price) => {
else if (price <= 0.01) decimals = 5;
return price.toFixed(decimals);
};
/* Cuts string off at given length, and adds an ellipse */
export const truncateStr = (str, len = 60, ellipse = '...') => {
return str.length > len + ellipse.length ? `${str.slice(0, len)}${ellipse}` : str;
};