msbot
Version:
MSBot command line tool for manipulating Microsoft Bot Framework .bot files
27 lines • 1.07 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
class ServiceVersion {
constructor(version) {
const versionPattern = /([0-9]+)(?:\.([0-9]+)(?:\.([0-9]+)(?:\.([0-9]+))?)?)?/;
const versions = versionPattern.exec(version) || ['0', '0', '0', '0', '0'];
this.major = parseInt(versions[1]);
this.minor = parseInt(versions[2]) || 0;
this.patch = parseInt(versions[3]) || 0;
this.revision = parseInt(versions[4]) || 0;
}
isOlder(version) {
let thisVersion = [this.major, this.minor, this.patch, this.revision];
let theirVersion = [version.major, version.minor, version.patch, version.revision];
for (let i = 0; i < thisVersion.length; i++) {
if (thisVersion[i] < theirVersion[i]) {
return true;
}
if (thisVersion[i] > theirVersion[i]) {
return false;
}
}
return false;
}
}
exports.ServiceVersion = ServiceVersion;
//# sourceMappingURL=msbot-clone-service-version.js.map