MCPcopy Index your code
hub / github.com/nodejs/node / tryParseComponents

Function tryParseComponents

test/fixtures/snapshot/typescript.js:3354–3370  ·  view source on GitHub ↗
(text)

Source from the content-addressed store, hash-verified

3352 }());
3353 ts.Version = Version;
3354 function tryParseComponents(text) {
3355 var match = versionRegExp.exec(text);
3356 if (!match)
3357 return undefined;
3358 var major = match[1], _a = match[2], minor = _a === void 0 ? "0" : _a, _b = match[3], patch = _b === void 0 ? "0" : _b, _c = match[4], prerelease = _c === void 0 ? "" : _c, _d = match[5], build = _d === void 0 ? "" : _d;
3359 if (prerelease && !prereleaseRegExp.test(prerelease))
3360 return undefined;
3361 if (build && !buildRegExp.test(build))
3362 return undefined;
3363 return {
3364 major: parseInt(major, 10),
3365 minor: parseInt(minor, 10),
3366 patch: parseInt(patch, 10),
3367 prerelease: prerelease,
3368 build: build
3369 };
3370 }
3371 function comparePrereleaseIdentifiers(left, right) {
3372 // https://semver.org/#spec-item-11
3373 // > When major, minor, and patch are equal, a pre-release version has lower precedence

Callers 2

VersionFunction · 0.85
typescript.jsFile · 0.85

Calls 2

execMethod · 0.45
testMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…