UNPKG

@kiwigdc/kiwilaunch

Version:
41 lines (40 loc) 1.27 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.LibsInformations = void 0; class LibsInformations { constructor(info) { var splitted = info.split(':'); this.informations = { dir: splitted[0], name: splitted[1], version: splitted[2] }; } getDir() { return this.informations.dir; } getName() { return this.informations.name; } getVersion() { return this.informations.version; } compareVersion(ver) { if (this.informations.version == ver) { return false; } else { var verLocal = LibsInformations.versionSplit(this.informations.version); var verDist = LibsInformations.versionSplit(ver); for (let i = verLocal.length - 1; i > 0; i--) { const local = verLocal[i]; const dist = verDist[i] != undefined ? verDist[i] : 0; if (dist < local) { return true; } } return false; } } static versionSplit(ver) { var split = ver.split('.').map(Number); return split; } } exports.LibsInformations = LibsInformations;