tessl install tessl/npm-glob-to-regexp@0.4.0Convert globs to regular expressions
Agent Success
Agent success rate when using this tile
100%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.15x
Baseline
Agent success rate without this tile
87%
Build a file filtering system that can match file paths against user-provided patterns with flexible matching options.
The system should provide a function createFilter(pattern, options) that:
caseSensitive (boolean, default: true): Whether matching should be case-sensitivematchAnywhere (boolean, default: false): Whether to match the pattern anywhere in the string (not just exact matches)The filter function should use the appropriate flags when converting the glob pattern to a regular expression:
caseSensitive is false, matching should be case-insensitivematchAnywhere is true, the pattern should match anywhere in the input string@generates
/**
* Creates a filter function based on a glob pattern and options
* @param {string} pattern - Glob pattern to match against
* @param {Object} options - Matching options
* @param {boolean} [options.caseSensitive=true] - Whether matching should be case-sensitive
* @param {boolean} [options.matchAnywhere=false] - Whether to match pattern anywhere in the string
* @returns {Function} Filter function that takes a string and returns boolean
*/
function createFilter(pattern, options) {
// Implementation here
}
module.exports = { createFilter };Provides glob pattern to regular expression conversion.
@satisfied-by