Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
quarto-dev
GitHub Repository: quarto-dev/quarto-cli
Path: blob/main/src/core/deno/expand-glob.ts
3583 views
1
/*
2
* expand-glob.ts
3
*
4
* Copyright (C) 2023 Posit Software, PBC
5
*
6
* Fixed version of expandGlob, expandGlobSync (https://github.com/denoland/deno_std/issues/3099)
7
*/
8
9
import {
10
expandGlob as badExpandGlob,
11
ExpandGlobOptions,
12
expandGlobSync as badExpandGlobSync,
13
} from "../../deno_ral/fs.ts";
14
15
export function expandGlobSync(
16
glob: string,
17
options?: ExpandGlobOptions,
18
): ReturnType<typeof badExpandGlobSync> {
19
if (options === undefined) {
20
return badExpandGlobSync(glob, { globstar: true });
21
} else {
22
return badExpandGlobSync(glob, {
23
...options,
24
globstar: options.globstar ?? true,
25
});
26
}
27
}
28
29
export function expandGlob(
30
glob: string,
31
options?: ExpandGlobOptions,
32
): ReturnType<typeof badExpandGlob> {
33
if (options === undefined) {
34
return badExpandGlob(glob, { globstar: true });
35
} else {
36
return badExpandGlob(glob, {
37
...options,
38
globstar: options.globstar ?? true,
39
});
40
}
41
}
42
43