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

Function Version

test/fixtures/snapshot/typescript.js:3285–3304  ·  view source on GitHub ↗
(major, minor, patch, prerelease, build)

Source from the content-addressed store, hash-verified

3283 */
3284 var Version = /** @class */ (function () {
3285 function Version(major, minor, patch, prerelease, build) {
3286 if (minor === void 0) { minor = 0; }
3287 if (patch === void 0) { patch = 0; }
3288 if (prerelease === void 0) { prerelease = ""; }
3289 if (build === void 0) { build = ""; }
3290 if (typeof major === "string") {
3291 var result = ts.Debug.checkDefined(tryParseComponents(major), "Invalid version");
3292 (major = result.major, minor = result.minor, patch = result.patch, prerelease = result.prerelease, build = result.build);
3293 }
3294 ts.Debug.assert(major >= 0, "Invalid argument: major");
3295 ts.Debug.assert(minor >= 0, "Invalid argument: minor");
3296 ts.Debug.assert(patch >= 0, "Invalid argument: patch");
3297 ts.Debug.assert(!prerelease || prereleaseRegExp.test(prerelease), "Invalid argument: prerelease");
3298 ts.Debug.assert(!build || buildRegExp.test(build), "Invalid argument: build");
3299 this.major = major;
3300 this.minor = minor;
3301 this.patch = patch;
3302 this.prerelease = prerelease ? prerelease.split(".") : ts.emptyArray;
3303 this.build = build ? build.split(".") : ts.emptyArray;
3304 }
3305 Version.tryParse = function (text) {
3306 var result = tryParseComponents(text);
3307 if (!result)

Callers

nothing calls this directly

Calls 4

tryParseComponentsFunction · 0.85
assertMethod · 0.80
testMethod · 0.45
splitMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…