Skip to main content
Deno 2 is finally here 🎉️
Learn more

glob-filter

deno doc

Check if a glob matches a filepath.

Usage

import { checkFile, filterFiles } from 'https://deno.land/x/glob_filter/mod.ts'

filterFiles(['./some-file.ts', 'other-file.ts', 'file/in/dir'], { match: '**/*.ts', ignore: '**/*dir*' })
// -> ['./some-file.ts', 'other-file.ts']

checkFile({ file: './some-file.ts', glob: { match: ['**/*.test.ts', 'test/*.ts']} })
// -> false