diff options
| author | Vincent LE GOFF <g_n_s@hotmail.fr> | 2019-03-18 16:08:01 +0100 |
|---|---|---|
| committer | Ryan Dahl <ry@tinyclouds.org> | 2019-03-18 11:08:01 -0400 |
| commit | 2e1ed890b85d4ecf1a6332cf2e0c121d5640b496 (patch) | |
| tree | 6675fa9c8ed42d3e2d85583f5be3ce6456f2af9c /fs | |
| parent | d1b0a1ef6c9cf0726687402bd12ce9ad4ead8424 (diff) | |
Documentation clean up (denoland/deno_std#288)
Original: https://github.com/denoland/deno_std/commit/b699fa67befaef4423f365e55eff0fec2e14def8
Diffstat (limited to 'fs')
| -rw-r--r-- | fs/glob.ts | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/fs/glob.ts b/fs/glob.ts index 4d4ccc7ce..4e1dedda9 100644 --- a/fs/glob.ts +++ b/fs/glob.ts @@ -20,27 +20,24 @@ export interface GlobOptions { * 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: [glob("*.ts")] + * }) + * + * Looking for all the `.json` files in any subfolder: + * walkSync(".", { + * match: [glob(join("a", "**", "*.json"),flags: "g", + * extended: true, + * globstar: true + * })] + * }) + * * @param glob - Glob pattern to be used * @param options - Specific options for the glob pattern * @returns A RegExp for the glob pattern - * @example - * Looking for all the `ts` files - * ```typescript - * walkSync(".", { - * match: [glob("*.ts")] - * }) - * ``` - * @example - * Looking for all the `.json` files in any subfolder - * of the `a` folder - * ```typescript - * walkSync(".", { - * match: [glob(join("a", "**", "*.json"),flags: "g", - * extended: true, - * globstar: true - * })] - * }) - * ``` */ export function glob(glob: string, options: GlobOptions = {}): RegExp { return globrex(glob, options).regex; |
