"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isDatedCodeName = isDatedCodeName;
exports.getDatedContainerImageCodename = getDatedContainerImageCodename;
exports.getDatedContainerImageVersion = getDatedContainerImageVersion;
const regex_1 = require("../../../util/regex");
function isDatedCodeName(input) {
    return (0, regex_1.regEx)(/^(?<codename>\w+)-(?<date>\d{8})$/).test(input);
}
function getDatedContainerImageCodename(version) {
    const groups = (0, regex_1.regEx)(/^(?<codename>\w+)-(?<date>\d{8})$/).exec(version);
    if (!groups?.groups) {
        return null;
    }
    return groups.groups.codename;
}
function getDatedContainerImageVersion(version) {
    const groups = (0, regex_1.regEx)(/^(?<codename>\w+)-(?<date>\d{8})$/).exec(version);
    if (!groups?.groups) {
        return null;
    }
    return parseInt(groups.groups.date, 10);
}
//# sourceMappingURL=common.js.map