port: from the old factory (tea-mcp/src/persimmons-extension), as it was, 2026-10-14

This commit is contained in:
teahubxyz committed 2026-10-14 00:22:00 -07:00
commit 0e92a80b20
30 files changed
+1944

No files matched your search

+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 '';
}