mirror of
https://github.com/Aviortheking/codestats-readme.git
synced 2025-07-29 07:19:51 +00:00
feat: added ability to set custom cache
This commit is contained in:
@ -75,7 +75,7 @@ const renderRepoCard = (repo, options = {}) => {
|
||||
`;
|
||||
|
||||
const svgForks =
|
||||
totalForks > 0 &&
|
||||
forkCount > 0 &&
|
||||
`
|
||||
<svg class="icon" y="-12" viewBox="0 0 16 16" version="1.1" width="16" height="16">
|
||||
${icons.fork}
|
||||
|
12
src/utils.js
12
src/utils.js
@ -44,6 +44,10 @@ function parseBoolean(value) {
|
||||
}
|
||||
}
|
||||
|
||||
function clampValue(number, min, max) {
|
||||
return Math.max(min, Math.min(number, max));
|
||||
}
|
||||
|
||||
function fallbackColor(color, fallbackColor) {
|
||||
return (isValidHexColor(color) && `#${color}`) || fallbackColor;
|
||||
}
|
||||
@ -112,6 +116,12 @@ function getCardColors({
|
||||
return { titleColor, iconColor, textColor, bgColor };
|
||||
}
|
||||
|
||||
const CONSTANTS = {
|
||||
THIRTY_MINUTES: 1800,
|
||||
TWO_HOURS: 7200,
|
||||
ONE_DAY: 86400,
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
renderError,
|
||||
kFormatter,
|
||||
@ -122,4 +132,6 @@ module.exports = {
|
||||
fallbackColor,
|
||||
FlexLayout,
|
||||
getCardColors,
|
||||
clampValue,
|
||||
CONSTANTS,
|
||||
};
|
||||
|
Reference in New Issue
Block a user