Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(std/path): Align globToRegExp() with bash glob expansion #7209

Merged
merged 2 commits into from
Oct 1, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions std/fs/expand_glob.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,17 @@ function comparePath(a: WalkEntry, b: WalkEntry): number {
return 0;
}

/**
* Expand the glob string from the specified `root` directory and yield each
/** Expand the glob string from the specified `root` directory and yield each
* result as a `WalkEntry` object.
*
* Examples:
* See [`globToRegExp()`](../path/glob.ts#globToRegExp) for details on supported
* syntax.
*
* for await (const file of expandGlob("**\/*.ts")) {
* console.log(file);
* }
* Example:
*
* for await (const file of expandGlob("**\/*.ts")) {
* console.log(file);
* }
*/
export async function* expandGlob(
glob: string,
Expand Down Expand Up @@ -167,15 +169,13 @@ export async function* expandGlob(
yield* currentMatches;
}

/**
* Synchronous version of `expandGlob()`.
/** Synchronous version of `expandGlob()`.
*
* Examples:
* Example:
*
* for (const file of expandGlobSync("**\/*.ts")) {
* console.log(file);
* }
*/
* for (const file of expandGlobSync("**\/*.ts")) {
* console.log(file);
* } */
nayeemrmn marked this conversation as resolved.
Show resolved Hide resolved
export function* expandGlobSync(
glob: string,
{
Expand Down
Loading