fix(fs): change globstar default to true for expandGlob and expandGlobSync (#3115)

This commit is contained in:
Kamil Ogórek 2023-01-16 16:26:27 +01:00 committed by GitHub
parent 13d469a191
commit b55fb2e311
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 5 deletions

View File

@ -80,7 +80,7 @@ export async function* expandGlob(
exclude = [],
includeDirs = true,
extended = true,
globstar = false,
globstar = true,
caseInsensitive,
}: ExpandGlobOptions = {},
): AsyncIterableIterator<WalkEntry> {
@ -199,7 +199,7 @@ export function* expandGlobSync(
exclude = [],
includeDirs = true,
extended = true,
globstar = false,
globstar = true,
caseInsensitive,
}: ExpandGlobOptions = {},
): IterableIterator<WalkEntry> {

View File

@ -46,7 +46,6 @@ const EG_OPTIONS: ExpandGlobOptions = {
root: fromFileUrl(new URL(join("testdata", "glob"), import.meta.url)),
includeDirs: true,
extended: false,
globstar: false,
};
Deno.test("expandGlobWildcard", async function () {
@ -97,9 +96,9 @@ Deno.test("expandGlobExt", async function () {
});
Deno.test("expandGlobGlobstar", async function () {
const options = { ...EG_OPTIONS, globstar: true };
const options = { ...EG_OPTIONS };
assertEquals(
await expandGlobArray(joinGlobs(["**", "abc"], options), options),
await expandGlobArray("**/abc", options),
["abc", join("subdir", "abc")],
);
});