MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / isUpdateAvailable

Function isUpdateAvailable

src/upgrade/index.ts:183–191  ·  view source on GitHub ↗
(current: string, latest: string)

Source from the content-addressed store, hash-verified

181}
182
183export function isUpdateAvailable(current: string, latest: string): boolean {
184 try {
185 return compareVersions(latest, current) > 0;
186 } catch {
187 // If either is unparseable (e.g. a dev "0.0.0-unknown"), treat differing
188 // strings as "update available" so the user isn't stuck.
189 return normalizeVersion(current) !== normalizeVersion(latest);
190 }
191}
192
193/** `0.9.9` / `v0.9.9` → `v0.9.9` (release tags are v-prefixed). */
194export function normalizeVersion(v: string): string {

Callers 3

noticeFromFunction · 0.90
upgrade.test.tsFile · 0.90
runUpgradeFunction · 0.85

Calls 2

compareVersionsFunction · 0.85
normalizeVersionFunction · 0.85

Tested by

no test coverage detected