MCPcopy
hub / github.com/ionic-team/capacitor / readdirp

Function readdirp

cli/src/util/fs.ts:38–53  ·  view source on GitHub ↗
(dir: string, { filter }: ReaddirPOptions)

Source from the content-addressed store, hash-verified

36}
37
38export async function readdirp(dir: string, { filter }: ReaddirPOptions): Promise<string[]> {
39 const dirContent = await readdir(dir, { recursive: true });
40 const dirContentWalker: WalkerItem[] = [];
41 const filteredContent: string[] = [];
42 dirContent.forEach((element) => {
43 const path = join(dir, element);
44 const stats = statSync(path);
45 dirContentWalker.push({ path, stats });
46 });
47 dirContentWalker.forEach((element) => {
48 if (filter(element)) {
49 filteredContent.push(element.path);
50 }
51 });
52 return filteredContent;
53}

Callers 3

checkPackageFunction · 0.90
getPluginFilesFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected