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

Function parseVersionParts

apps/desktop/src/main/index.ts:157–162  ·  view source on GitHub ↗
(version: string)

Source from the content-addressed store, hash-verified

155const delay = (ms: number): Promise<void> => new Promise((r) => setTimeout(r, ms));
156
157const parseVersionParts = (version: string): readonly number[] | null => {
158 const core = version.trim().split(/[+-]/, 1)[0];
159 if (!core) return null;
160 const parts = core.split(".").map((part) => Number.parseInt(part, 10));
161 return parts.every((part) => Number.isInteger(part) && part >= 0) ? parts : null;
162};
163
164const compareVersions = (left: string, right: string): number | null => {
165 const leftParts = parseVersionParts(left);

Callers 1

compareVersionsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected