CtrlK
CommunityDocumentationLog inGet started
Tessl Logo

tessl/npm-anymatch

tessl install tessl/npm-anymatch@3.1.0

Matches 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%

task.mdevals/scenario-8/

Cross-platform Path Filter

Normalize mixed-separator file system paths while preserving trailing separators so directory-aware include/exclude rules behave consistently across platforms.

Capabilities

Preserves directory markers during normalization

  • Given candidates ["tmp\\logs\\", "tmp\\logs\\error.log"] and include patterns ["tmp/**/"], only the normalized directory entry ["tmp/logs/"] is kept because the trailing separator is preserved while the file without a trailing separator is ignored. @test

Directory-only globs respect trailing separators

  • With include patterns of ["*/"] and no excludes, candidates ["logs/", "logs.txt", "logs\\archive\\"] resolve to ["logs/", "logs/archive/"]; the directory-only glob matches normalized entries ending in a separator and skips similarly named files. @test

Exclusions remove normalized directories

  • With include patterns ["src/**"] and exclude patterns ["**/node_modules/"], candidates ["src/index.js", "src\\node_modules\\", "src\\node_modules\\leftpad\\index.js"] resolve to ["src/index.js"] because the normalized directory entries with trailing separators match the exclusion glob. @test

Implementation

@generates

API

export interface PathSelectionOptions {
  include?: Array<string | RegExp>;
  exclude?: Array<string | RegExp>;
}

/**
 * Returns the subset of candidate paths that pass include/exclude rules.
 * Paths are normalized to forward slashes while preserving any trailing separator from the input.
 * When include is omitted all candidates start as matched; excludes are applied afterward without reordering results.
 */
export function selectPaths(
  candidates: string[],
  options?: PathSelectionOptions
): string[];

Dependencies { .dependencies }

anymatch { .dependency }

Match mixed-separator paths against string, glob, or regex criteria while preserving trailing separators for directory-aware patterns.

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
npmpkg:npm/anymatch@3.1.x
tile.json