MCPcopy Create free account
hub / github.com/NativeScript/NativeScript / walk

Function walk

packages/vite/configuration/javascript.ts:35–54  ·  view source on GitHub ↗
(dir: string, out: string[])

Source from the content-addressed store, hash-verified

33 const roots = [appRoot];
34 const styleExtsSet = new Set(['css', 'scss', 'less', 'sass']);
35 function walk(dir: string, out: string[]) {
36 let entries: string[] = [];
37 try {
38 entries = readdirSync(dir);
39 } catch {
40 return out;
41 }
42 for (const entry of entries) {
43 const full = path.posix.join(dir, entry);
44 let st: any;
45 try {
46 st = statSync(full);
47 } catch {
48 continue;
49 }
50 if (st.isDirectory()) walk(full, out);
51 else out.push(full);
52 }
53 return out;
54 }
55 function enumerate(filter: (ext: string) => boolean) {
56 const files: string[] = [];
57 for (const r of roots) walk(r, files);

Callers 1

enumerateFunction · 0.70

Calls 2

joinMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected