Version utility
SemVer helpers for update analysis.
- Methods: compare(v1, v2), isBreakingChange(old, new), analyzeVersion(old, new)
- Result type: VersionCheckResult
TSXVersion util
1import { Version } from "@quan-erp/shared-frontend-core";
2
3export function shouldForceUpdate(installed: string, latest: string) {
4 const cmp = Version.compare(installed, latest);
5 // cmp < 0 means installed is behind latest (confirm sign in your package)
6 const breaking = Version.isBreakingChange(installed, latest);
7 const analysis = Version.analyzeVersion(installed, latest);
8 return { cmp, breaking, analysis };
9}
10
11// Example: shouldForceUpdate("1.2.0", "2.0.0")