"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PackageNameMatcher = void 0;
const tslib_1 = require("tslib");
const is_1 = tslib_1.__importDefault(require("@sindresorhus/is"));
const base_1 = require("./base");
class PackageNameMatcher extends base_1.Matcher {
    matches({ depName, packageName }, { matchPackageNames }) {
        if (is_1.default.undefined(matchPackageNames)) {
            return null;
        }
        if (is_1.default.undefined(depName)) {
            return false;
        }
        if (matchPackageNames.includes(depName)) {
            return true;
        }
        if (is_1.default.string(packageName) &&
            process.env.RENOVATE_X_MATCH_PACKAGE_NAMES_MORE) {
            return matchPackageNames.includes(packageName);
        }
        return false;
    }
    excludes({ depName }, { excludePackageNames }) {
        if (is_1.default.undefined(excludePackageNames)) {
            return null;
        }
        if (is_1.default.undefined(depName)) {
            return false;
        }
        return excludePackageNames.includes(depName);
    }
}
exports.PackageNameMatcher = PackageNameMatcher;
//# sourceMappingURL=package-names.js.map