tessl install tessl/npm-anymatch@3.1.0Matches strings against configurable strings, globs, regular expressions, and/or functions
Agent Success
Agent success rate when using this tile
76%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.12x
Baseline
Agent success rate without this tile
68%
Build a small helper that validates matcher configuration and evaluates paths using flexible matcher types while tolerating unsupported entries.
TypeError. @test[string, ...extras] to the evaluator throws a TypeError. @test["src/app.js", { lang: "js" }] returns true when the predicate approves the meta; plain string inputs that do not satisfy any matcher return false. @test"any/path.js" returns false. When supported matchers are present and returnIndex is requested, the evaluator reports the index of the first supported match while skipping unsupported entries. @test@generates
/**
* Creates an evaluator for matching paths against flexible matchers.
*
* @param {string|RegExp|Function|(string|RegExp|Function)[]} matchers - Required matchers to test paths against.
* @param {object} [options] - Optional matching options passed to the underlying matcher engine.
* @returns {(value: string | [string, ...unknown[]], opts?: { returnIndex?: boolean }) => boolean | number}
* A function that evaluates a test value and returns either a boolean or the index of the first matching matcher (or -1 when none match) when returnIndex is true.
*/
export function createEvaluator(matchers, options) {}Matches strings against glob, regexp, or predicate matchers while supporting optional return of the matching index and tolerant handling of unsupported matcher entries.
@satisfied-by