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

Function compareVersions

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

Source from the content-addressed store, hash-verified

162};
163
164const compareVersions = (left: string, right: string): number | null => {
165 const leftParts = parseVersionParts(left);
166 const rightParts = parseVersionParts(right);
167 if (!leftParts || !rightParts) return null;
168 const length = Math.max(leftParts.length, rightParts.length);
169 for (let index = 0; index < length; index += 1) {
170 const l = leftParts[index] ?? 0;
171 const r = rightParts[index] ?? 0;
172 if (l !== r) return l > r ? 1 : -1;
173 }
174 return 0;
175};
176
177const shouldUpgradeDaemonForDesktop = (daemonVersion: string | null): boolean => {
178 if (!daemonVersion) return false;

Callers 1

Calls 1

parseVersionPartsFunction · 0.70

Tested by

no test coverage detected