mirror of
https://github.com/Studio-Saelix/sencho.git
synced 2026-07-29 05:09:10 +00:00
d23c6779af
- Fix completed-entry auto-expiry using resolvedAt instead of startedAt - Add admin role enforcement to update trigger and update-all endpoints - Add missing error field in rejected-promise fallback for update-status - Fix rejected promises in update-all losing node names - Harden frontend recheck button with try/catch/finally error handling - Align frontend isValidVersion with stricter regex validation - Add diagnostic logging gated behind developer_mode - Extract resolveTracker helper to centralize terminal state transitions - Add 15 new fleet test cases covering auth, tier gating, input validation, and admin roles - Document admin requirement and troubleshooting in fleet-view docs
11 lines
495 B
TypeScript
11 lines
495 B
TypeScript
/** Returns true when the string is a displayable semver version (not a placeholder or missing). */
|
|
export function isValidVersion(v: string | null | undefined): v is string {
|
|
return !!v && v !== 'unknown' && v !== '0.0.0-dev' && /^\d+\.\d+\.\d+(-[\w.]+)?$/.test(v);
|
|
}
|
|
|
|
/** Format a version string for display, returning null for invalid/missing values. */
|
|
export function formatVersion(v: string | null | undefined): string | null {
|
|
if (!isValidVersion(v)) return null;
|
|
return `v${v}`;
|
|
}
|