"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.validatePackageName = void 0;
const utils_1 = require("../../utils");
function validatePackageName(packageName, validPackageNames) {
    const replacementMap = {
        '{{': '[',
        '}}': ']',
    };
    return validPackageNames.some(isValidPackageName(packageName, replacementMap));
}
exports.validatePackageName = validatePackageName;
function isValidPackageName(packageName, replacementMap) {
    return (packageNameTemplate) => {
        const packageNamePattern = utils_1.replaceAllSubstrings(packageNameTemplate, replacementMap);
        const packageNamePatternRegex = new RegExp(packageNamePattern);
        return packageNamePatternRegex.test(packageName);
    };
}
//# sourceMappingURL=validatePackageName.js.map