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

Function parseVersionParts

apps/desktop/src/main/updater-state.ts:31–36  ·  view source on GitHub ↗
(version: string)

Source from the content-addressed store, hash-verified

29}
30
31const parseVersionParts = (version: string): readonly number[] | null => {
32 const core = version.trim().split(/[+-]/, 1)[0];
33 if (!core) return null;
34 const parts = core.split(".").map((part) => Number.parseInt(part, 10));
35 return parts.every((part) => Number.isInteger(part) && part >= 0) ? parts : null;
36};
37
38export const compareUpdateVersions = (left: string, right: string): number | null => {
39 const leftParts = parseVersionParts(left);

Callers 1

compareUpdateVersionsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected