From b55fb2e31124fa95d5aa387382853df54e43acd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Og=C3=B3rek?= Date: Mon, 16 Jan 2023 16:26:27 +0100 Subject: [PATCH] fix(fs): change globstar default to true for expandGlob and expandGlobSync (#3115) --- fs/expand_glob.ts | 4 ++-- fs/expand_glob_test.ts | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/fs/expand_glob.ts b/fs/expand_glob.ts index 2b59c76fd..e271227fa 100644 --- a/fs/expand_glob.ts +++ b/fs/expand_glob.ts @@ -80,7 +80,7 @@ export async function* expandGlob( exclude = [], includeDirs = true, extended = true, - globstar = false, + globstar = true, caseInsensitive, }: ExpandGlobOptions = {}, ): AsyncIterableIterator { @@ -199,7 +199,7 @@ export function* expandGlobSync( exclude = [], includeDirs = true, extended = true, - globstar = false, + globstar = true, caseInsensitive, }: ExpandGlobOptions = {}, ): IterableIterator { diff --git a/fs/expand_glob_test.ts b/fs/expand_glob_test.ts index a3df5c088..752d73b60 100644 --- a/fs/expand_glob_test.ts +++ b/fs/expand_glob_test.ts @@ -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")], ); });