MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / compareVersions

Function compareVersions

apps/desktop/src/main/index.ts:197–208  ·  view source on GitHub ↗
(left: string, right: string)

Source from the content-addressed store, hash-verified

195};
196
197const compareVersions = (left: string, right: string): number | null => {
198 const leftParts = parseVersionParts(left);
199 const rightParts = parseVersionParts(right);
200 if (!leftParts || !rightParts) return null;
201 const length = Math.max(leftParts.length, rightParts.length);
202 for (let index = 0; index < length; index += 1) {
203 const l = leftParts[index] ?? 0;
204 const r = rightParts[index] ?? 0;
205 if (l !== r) return l > r ? 1 : -1;
206 }
207 return 0;
208};
209
210const shouldUpgradeDaemonForDesktop = (daemonVersion: string | null): boolean => {
211 if (!daemonVersion) return false;

Callers 1

Calls 1

parseVersionPartsFunction · 0.70

Tested by

no test coverage detected