or run

tessl search
Log in

Version

Files

tile.json

task.mdevals/scenario-7/

Directory File Filter

A utility that filters file paths in a directory structure to find files matching specific patterns across multiple directory levels.

Capabilities

Deep directory filtering

  • When given an array of file paths including nested directories and a pattern **/*.js, it returns only JavaScript files at any depth level @test
  • When given file paths at various depths with pattern src/**/*.test.js, it returns only test files within the src directory tree @test

Multiple level traversal

  • When given paths like ['a/file.txt', 'a/b/file.txt', 'a/b/c/file.txt'] with pattern a/**/file.txt, it returns all three files @test

Implementation

@generates

API

/**
 * Filters an array of file paths against a glob pattern.
 *
 * @param {string[]} paths - Array of file paths to filter
 * @param {string} pattern - Glob pattern to match against
 * @returns {string[]} Array of matching file paths
 */
function filterPaths(paths, pattern) {
  // IMPLEMENTATION HERE
}

module.exports = { filterPaths };

Dependencies { .dependencies }

micromatch { .dependency }

Provides glob pattern matching with globstar support for multi-level directory traversal.