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

Function compareVersions

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

Source from the content-addressed store, hash-verified

202};
203
204const compareVersions = (left: string, right: string): number | null => {
205 const leftParts = parseVersionParts(left);
206 const rightParts = parseVersionParts(right);
207 if (!leftParts || !rightParts) return null;
208 const length = Math.max(leftParts.length, rightParts.length);
209 for (let index = 0; index < length; index += 1) {
210 const l = leftParts[index] ?? 0;
211 const r = rightParts[index] ?? 0;
212 if (l !== r) return l > r ? 1 : -1;
213 }
214 return 0;
215};
216
217const shouldUpgradeDaemonForDesktop = (daemonVersion: string | null): boolean => {
218 if (!daemonVersion) return false;

Callers 1

Calls 1

parseVersionPartsFunction · 0.70

Tested by

no test coverage detected