MCPcopy Create free account
hub / github.com/EvoMap/evolver / _shouldUpgrade

Method _shouldUpgrade

src/proxy/lifecycle/manager.js:1536–1549  ·  view source on GitHub ↗
(minVersion)

Source from the content-addressed store, hash-verified

1534 }
1535
1536 _shouldUpgrade(minVersion) {
1537 // parseInt strips trailing non-digit chars in prerelease segments like
1538 // `1-beta`, so `0.1.1-beta.1`.split('.')[2] -> `1-beta` -> parseInt = 1.
1539 // Using Number() here returned NaN and was treated as 0, under-counting
1540 // prerelease minimums. See community PR #516.
1541 const parse = (v) => String(v || '0.0.0').split('.').map((part) => parseInt(part, 10));
1542 const min = parse(minVersion);
1543 const cur = parse(PROXY_PROTOCOL_VERSION);
1544 for (let i = 0; i < 3; i++) {
1545 if ((cur[i] || 0) < (min[i] || 0)) return true;
1546 if ((cur[i] || 0) > (min[i] || 0)) return false;
1547 }
1548 return false;
1549 }
1550}
1551
1552module.exports = {

Callers 2

heartbeatMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected