MCPcopy Create free account
hub / github.com/vercel/vercel / gatherExtraFiles

Function gatherExtraFiles

packages/rust/src/lib/utils.ts:28–49  ·  view source on GitHub ↗
(
  globMatcher: string | string[] | undefined,
  workPath: string
)

Source from the content-addressed store, hash-verified

26}
27
28export async function gatherExtraFiles(
29 globMatcher: string | string[] | undefined,
30 workPath: string
31): Promise<Record<string, FileFsRef>> {
32 if (!globMatcher) return {};
33
34 debug(
35 `Gathering extra files for glob \`${JSON.stringify(
36 globMatcher
37 )}\` in ${workPath}`
38 );
39
40 if (Array.isArray(globMatcher)) {
41 const allMatches = await Promise.all(
42 globMatcher.map(pattern => glob(pattern, workPath))
43 );
44
45 return allMatches.reduce((acc, matches) => ({ ...acc, ...matches }), {});
46 }
47
48 return glob(globMatcher, workPath);
49}

Callers 1

buildHandlerFunction · 0.90

Calls 2

debugFunction · 0.90
globFunction · 0.90

Tested by

no test coverage detected