Convert globs to regular expressions
Overall
score
100%
{
"context": "This criteria evaluates how well the engineer uses the glob-to-regexp package to implement single-character wildcard pattern matching. The focus is on proper usage of the extended mode option and the globToRegExp function.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Import glob-to-regexp",
"description": "The solution imports or requires the glob-to-regexp package correctly (e.g., const globToRegExp = require('glob-to-regexp') or similar)",
"max_score": 10
},
{
"name": "Use globToRegExp function",
"description": "The solution calls the globToRegExp function with the pattern parameter as the first argument",
"max_score": 25
},
{
"name": "Enable extended mode",
"description": "The solution passes { extended: true } as the options parameter to globToRegExp to enable single-character wildcard matching with '?'",
"max_score": 35
},
{
"name": "Test against filename",
"description": "The solution uses the RegExp returned by globToRegExp to test the filename parameter (e.g., using .test() method or similar)",
"max_score": 20
},
{
"name": "Return boolean result",
"description": "The solution returns a boolean value indicating whether the filename matches the pattern",
"max_score": 10
}
]
}Install with Tessl CLI
npx tessl i tessl/npm-glob-to-regexpdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9