MCPcopy Create free account
hub / github.com/ProtonDriveApps/sdk / compareSemverLoose

Function compareSemverLoose

cli/src/api/apiRequirements.ts:125–137  ·  view source on GitHub ↗
(a: string, b: string)

Source from the content-addressed store, hash-verified

123}
124
125function compareSemverLoose(a: string, b: string): number | null {
126 const pa = parseSemverParts(a);
127 const pb = parseSemverParts(b);
128 if (!pa || !pb) {
129 return null;
130 }
131 for (let i = 0; i < 3; i++) {
132 if (pa[i] !== pb[i]) {
133 return pa[i] < pb[i] ? -1 : 1;
134 }
135 }
136 return 0;
137}
138
139function parseSemverParts(v: string): [number, number, number] | null {
140 const trimmed = v.trim();

Callers 1

isUpdateNeededFunction · 0.85

Calls 1

parseSemverPartsFunction · 0.85

Tested by

no test coverage detected