"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PathsMatcher = void 0;
const tslib_1 = require("tslib");
const is_1 = tslib_1.__importDefault(require("@sindresorhus/is"));
const minimatch_1 = require("minimatch");
const logger_1 = require("../../logger");
const base_1 = require("./base");
class PathsMatcher extends base_1.Matcher {
    matches({ packageFile }, { matchPaths }) {
        if (is_1.default.undefined(matchPaths)) {
            return null;
        }
        if (is_1.default.undefined(packageFile)) {
            return false;
        }
        return matchPaths.some((rulePath) => {
            if ((0, minimatch_1.minimatch)(packageFile, rulePath, { dot: true })) {
                return true;
            }
            if (packageFile.includes(rulePath)) {
                logger_1.logger.warn({
                    rulePath,
                    packageFile,
                }, 'Partial matches for `matchPaths` are deprecated. Please use a minimatch glob pattern or switch to `matchFiles` if you need exact matching.');
                return true;
            }
        });
    }
}
exports.PathsMatcher = PathsMatcher;
//# sourceMappingURL=paths.js.map