docs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10
Build a utility that filters file paths to identify files that should be excluded from a backup process based on configurable exclusion patterns.
The utility should identify files that do NOT match any of the given patterns. For example, when given a list of source file patterns, it should return all files that are NOT source files.
['src/index.js', 'README.md', 'package.json', 'test/unit.test.js'] and patterns ['**/*.js'], returns ['README.md', 'package.json'] @test['docs/api.md', 'docs/guide.md', 'src/main.ts', 'README.txt'] and patterns ['**/*.md'], returns ['src/main.ts', 'README.txt'] @testThe utility should support multiple patterns and exclude paths that match ANY of them.
['file.js', 'file.ts', 'file.css', 'file.txt'] and patterns ['*.js', '*.ts'], returns ['file.css', 'file.txt'] @testThe utility should correctly process paths with nested directory structures using globstar patterns.
['src/components/Button.jsx', 'src/utils/helper.js', 'docs/README.md', 'config.json'] and patterns ['src/**/*.jsx', 'src/**/*.js'], returns ['docs/README.md', 'config.json'] @test/**
* Filters a list of file paths to return only those that do NOT match any of the given glob patterns.
*
* @param {string[]} paths - Array of file paths to filter
* @param {string | string[]} patterns - Glob pattern(s) to exclude
* @returns {string[]} Array of paths that do not match any pattern
*/
function filterExcluded(paths, patterns) {
// IMPLEMENTATION HERE
}
module.exports = { filterExcluded };Provides glob pattern matching capabilities for filtering file paths.