MCPcopy Create free account
hub / github.com/compat-table/compat-table / parseVersion

Function parseVersion

build-utils/parse-envs-versions.js:36–50  ·  view source on GitHub ↗
(version)

Source from the content-addressed store, hash-verified

34}
35
36function parseVersion(version) {
37 if (!version) return null;
38
39 if (version === "tp") return ["tp"];
40
41 var match = version.match(RE.version);
42 if (!match) throw new Error("Unable to parse environment version: " + version);
43
44 if (match[1]) return match.slice(1, 4).map(Number);
45
46 var result = [];
47 for (var i = 4; i <= 6 && match[i]; i++) result.push(Number(match[i]));
48
49 return result;
50}
51
52
53

Callers 1

parseEnvIdFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected