core/predicates/filename.predicate.ts

core/predicates/filename.predicate.ts is a file in GovLab Quality. 7 lines of code and 2 definitions.

export const containsAny = function containsAny(filename: string, fragments?: readonly string[]): boolean {
    if (!fragments || fragments.length === 0) {
        return false;
    }
    const normalized = filename.split("\\").join("/");
    return fragments.some((fragment) => normalized.includes(fragment));
};