2017-08-17 14:15:47 +00:00
|
|
|
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
|
const plugins = require("./smartversion.plugins");
|
|
|
|
class SmartVersion {
|
|
|
|
constructor(semVerStringArg) {
|
|
|
|
this.update = {
|
|
|
|
patch: () => {
|
|
|
|
this.semver.patch = this.semver.patch + 1;
|
|
|
|
},
|
|
|
|
minor: () => {
|
|
|
|
this.semver.minor = this.semver.minor + 1;
|
|
|
|
},
|
|
|
|
major: () => {
|
|
|
|
this.semver.major = this.semver.major + 1;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
this.semver = new plugins.semver.SemVer(semVerStringArg);
|
2017-08-18 08:58:00 +00:00
|
|
|
this.versionString = this.semver.version;
|
2017-08-17 14:15:47 +00:00
|
|
|
}
|
|
|
|
get major() {
|
|
|
|
return this.semver.major;
|
|
|
|
}
|
|
|
|
get minor() {
|
|
|
|
return this.semver.minor;
|
|
|
|
}
|
|
|
|
get patch() {
|
|
|
|
return this.semver.patch;
|
|
|
|
}
|
2017-08-18 08:58:00 +00:00
|
|
|
greaterThanString(versionStringArg) {
|
|
|
|
return plugins.semver.gt(this.versionString, versionStringArg);
|
|
|
|
}
|
|
|
|
lessThanString(versionStringArg) {
|
|
|
|
return plugins.semver.lt(this.versionString, versionStringArg);
|
|
|
|
}
|
2017-08-17 14:15:47 +00:00
|
|
|
}
|
|
|
|
exports.SmartVersion = SmartVersion;
|
2017-08-18 08:58:00 +00:00
|
|
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLGtEQUFpRDtBQUlqRDtJQWVFLFlBQWEsZUFBdUI7UUFacEMsV0FBTSxHQUFHO1lBQ1AsS0FBSyxFQUFFO2dCQUNMLElBQUksQ0FBQyxNQUFNLENB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