"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PackagePrefixesMatcher = void 0;
const tslib_1 = require("tslib");
const is_1 = tslib_1.__importDefault(require("@sindresorhus/is"));
const base_1 = require("./base");
class PackagePrefixesMatcher extends base_1.Matcher {
    matches({ depName }, { matchPackagePrefixes }) {
        if (is_1.default.undefined(matchPackagePrefixes)) {
            return null;
        }
        if (is_1.default.undefined(depName)) {
            return false;
        }
        return matchPackagePrefixes.some((prefix) => depName.startsWith(prefix));
    }
    excludes({ depName }, { excludePackagePrefixes }) {
        if (is_1.default.undefined(excludePackagePrefixes)) {
            return null;
        }
        if (is_1.default.undefined(depName)) {
            return false;
        }
        return excludePackagePrefixes.some((prefix) => depName.startsWith(prefix));
    }
}
exports.PackagePrefixesMatcher = PackagePrefixesMatcher;
//# sourceMappingURL=package-prefixes.js.map