MCPcopy
hub / github.com/tinyplex/tinybase / forEachDeepFile

Function forEachDeepFile

site/shots.ts:19–31  ·  view source on GitHub ↗
(
  dir: string,
  callback: (filePath: string) => void,
  extension = '',
)

Source from the content-addressed store, hash-verified

17 value.replaceAll(/[.*+?^${}()|[\]\\]/g, '\\$&');
18
19const forEachDeepFile = (
20 dir: string,
21 callback: (filePath: string) => void,
22 extension = '',
23): void =>
24 readdirSync(dir, {withFileTypes: true}).forEach((entry) => {
25 const path = resolve(join(dir, entry.name));
26 if (entry.isDirectory()) {
27 forEachDeepFile(path, callback, extension);
28 } else if (extension == '' || path.endsWith(extension)) {
29 callback(path);
30 }
31 });
32
33const getDocShotRefs = (outDir: string): string[] => {
34 const shotDir = join(outDir, DOC_SHOT_DIR);

Callers 3

getDocShotRefsFunction · 0.70
rewritePublishedDocShotsFunction · 0.70
getPublishedDocShotRefsFunction · 0.70

Calls 1

joinFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…