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

Function compareVersions

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

Source from the content-addressed store, hash-verified

151};
152
153const compareVersions = (left: string, right: string): number | null => {
154 const leftParts = parseVersionParts(left);
155 const rightParts = parseVersionParts(right);
156 if (!leftParts || !rightParts) return null;
157 const length = Math.max(leftParts.length, rightParts.length);
158 for (let index = 0; index < length; index += 1) {
159 const l = leftParts[index] ?? 0;
160 const r = rightParts[index] ?? 0;
161 if (l !== r) return l > r ? 1 : -1;
162 }
163 return 0;
164};
165
166const shouldUpgradeDaemonForDesktop = (daemonVersion: string | null): boolean => {
167 if (!daemonVersion) return false;

Callers 1

Calls 1

parseVersionPartsFunction · 0.85

Tested by

no test coverage detected