MCPcopy Create free account
hub / github.com/alibaba/open-code-review / parseVersionOutput

Function parseVersionOutput

scripts/version.js:9–14  ·  view source on GitHub ↗
(output)

Source from the content-addressed store, hash-verified

7 /^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/;
8
9function parseVersionOutput(output) {
10 const match = String(output || "").match(
11 /v(\d+\.\d+(?:\.\d+)?(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?)/
12 );
13 return match ? match[1] : null;
14}
15
16function semverGt(a, b) {
17 if (!SEMVER_RE.test(a) || !SEMVER_RE.test(b)) return false;

Callers 2

getInstalledVersionFunction · 0.85
version.test.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected