import { globToRegExp } from "https://deno.land/std@0.54.0/path/glob.ts";
Generate a regex based on glob pattern and options
This was meant to be using the the fs.walk
function
but can be used anywhere else.
Examples:
Looking for all the `ts` files:
walkSync(".", {
match: [globToRegExp("*.ts")]
})
Looking for all the `.json` files in any subfolder:
walkSync(".", {
match: [globToRegExp(join("a", "**", "*.json"),{
flags: "g",
extended: true,
globstar: true
})]
})