"use strict";
/**
 * Copyright: (c) Myia SAS 2026.
 * This file and its contents are licensed under the AGPLv3 License.
 * Please see the LICENSE file at the root of this repository
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.defaultInclude = void 0;
exports.buildMatcher = buildMatcher;
exports.defaultInclude = [/\/tests\//];
function buildMatcher(include) {
    const entries = include == null ? exports.defaultInclude : Array.isArray(include) ? include : [include];
    return (filename) => {
        if (!filename)
            return false;
        for (const e of entries) {
            if (typeof e === 'string' && filename.includes(e))
                return true;
            if (e instanceof RegExp && e.test(filename))
                return true;
            if (typeof e === 'function' && e(filename))
                return true;
        }
        return false;
    };
}
