add card to inform user of new versions

This commit is contained in:
maxid
2025-12-06 22:38:28 +01:00
parent e522fa9801
commit d1eee14b79
3 changed files with 82 additions and 45 deletions

View File

@@ -118,3 +118,12 @@ export function saveDirectoryPreview(
}
return path;
}
export function semverIsGreater(a: string, b: string) {
return a.localeCompare(b, undefined, { numeric: true }) === 1;
}
export function isSemver(str: string) {
return str.match(
/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/
);
}