"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.VersionValidatorHelper = void 0;
const semver = require("semver");
class VersionValidatorHelper {
    isValidVersion(version) {
        return semver.valid(version) || semver.validRange(version);
    }
    isVersionGreaterThan(v1, v2) {
        return this.compareCoerceVersions(v1, v2, semver.gt);
    }
    isVersionGreaterOrEqualThan(v1, v2) {
        return this.compareCoerceVersions(v1, v2, semver.gte);
    }
    isVersionLowerThan(v1, v2) {
        return this.compareCoerceVersions(v1, v2, semver.lt);
    }
    isVersionLowerOrEqualThan(v1, v2) {
        return this.compareCoerceVersions(v1, v2, semver.lte);
    }
    compareCoerceVersions(version, minVersion, condition) {
        return condition(semver.coerce(version), semver.coerce(minVersion));
    }
}
exports.VersionValidatorHelper = VersionValidatorHelper;
//# sourceMappingURL=version-validator-helper.js.map