docs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10
A utility that filters file paths based on whether they contain specific patterns anywhere in the path, supporting both literal substring matching and glob patterns.
["src/components/Header.js", "lib/utils/helpers.js", "test/Header.test.js"] and pattern "Header", returns ["src/components/Header.js", "test/Header.test.js"] @test["config/prod.env", "config/dev.env", "src/index.js"] and pattern ".env", returns ["config/prod.env", "config/dev.env"] @test["docs/api/users.md", "src/api/auth.js", "test/users.test.js"] and pattern "api", returns ["docs/api/users.md", "src/api/auth.js"] @test["src/pages/home.tsx", "src/components/Button.tsx", "lib/utils.js"] and pattern "*.tsx", returns ["src/pages/home.tsx", "src/components/Button.tsx"] @test["app/models/user.rb", "app/views/index.html", "app/controllers/api.rb"] and pattern "app/**", returns all three paths @test["src/index.js", "lib/helper.js"] and pattern "test", returns empty array [] @test/**
* Filters an array of file paths, returning only those that contain
* the specified pattern anywhere in the path.
*
* Supports both literal substring matching and glob patterns.
*
* @param {string[]} paths - Array of file paths to filter
* @param {string} pattern - Pattern to search for (literal or glob)
* @returns {string[]} Array of paths containing the pattern
*/
function filterPaths(paths, pattern) {
// IMPLEMENTATION HERE
}
module.exports = { filterPaths };Provides glob pattern matching and substring detection capabilities.