import minimatch from 'minimatch'; type Args = { filename: string; include?: string[]; ignored?: string[]; }; export function validateFilename({ filename, include, ignored }: Args) { const isIgnored = !!ignored?.some((path) => minimatch(filename, path)); const isInclude = !!include?.some((path) => minimatch(filename, path)); if (!include?.length) return !isIgnored; return isInclude && !isIgnored; }