1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.nodeJsVer = void 0;
|
4 | class VersionContainer {
|
5 | constructor(version) {
|
6 | const arr = version.split(/[v.]/g).filter((v) => v !== "");
|
7 | this.major = Number.parseInt(arr[0], 10);
|
8 | this.minor = Number.parseInt(arr[1], 10);
|
9 |
|
10 | this.patch = arr[2] ? Number.parseInt(arr[2], 10) : 0;
|
11 | this.patchSuffix = arr[2] ? arr[2].replace(this.patch.toString(), "") : "";
|
12 | }
|
13 | valueOf() {
|
14 | return Number.parseInt(this.major.toString() + this.minor.toString() + this.patch.toString(), 10);
|
15 | }
|
16 | }
|
17 | exports.default = VersionContainer;
|
18 | exports.nodeJsVer = new VersionContainer(process.version);
|