MCPcopy
hub / github.com/Swatinem/rust-cache / globFiles

Function globFiles

src/config.ts:422–437  ·  view source on GitHub ↗
(pattern: string)

Source from the content-addressed store, hash-verified

420}
421
422async function globFiles(pattern: string): Promise<string[]> {
423 const globber = await glob.create(pattern, {
424 followSymbolicLinks: false,
425 });
426 // fs.stat resolve the symbolic link and returns stat for the
427 // file it pointed to, so isFile would make sure the resolved
428 // file is actually a regular file.
429 const files = [];
430 for (const file of await globber.glob()) {
431 const stats = await fs.stat(file);
432 if (stats.isFile()) {
433 files.push(file);
434 }
435 }
436 return files;
437}
438
439function sort_and_uniq(a: string[]) {
440 return a

Callers 1

newMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected