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

x/plugin_prepare/deps.ts>path.globToRegExp

A library for managing deno native plugin dependencies
Latest
function path.globToRegExp
import { path } from "https://deno.land/x/plugin_prepare@v0.8.0/deps.ts";
const { globToRegExp } = path;

Convert a glob string to a regular expressions.

 // 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"), {
     extended: true,
     globstar: true
   })]
 });

Parameters

glob: string
optional
unnamed 1: GlobToRegExpOptions = [UNSUPPORTED]

Returns

RegExp