Consolidate Persimmons source

This commit is contained in:
matcha committed 2026-10-04 02:46:56 +00:00
1 parent f1880a6ad1
commit b0e5d84d9c
1 file changed
+10
+10
View File
@@ -0,0 +1,10 @@
export function updateState(installed, latest) {
const parse = value => typeof value === 'string' && /^\d+(\.\d+){0,3}$/.test(value) ? value.split('.').map(Number) : null;
const a = parse(installed), b = parse(latest);
if (!a || !b) return '';
for (let i = 0; i < 4; i++) {
if ((a[i] || 0) < (b[i] || 0)) return 'Update available';
if ((a[i] || 0) > (b[i] || 0)) return '';
}
return '';
}