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

Function walk

scripts/crowdin-common.mjs:29–47  ·  view source on GitHub ↗
(dir, ext)

Source from the content-addressed store, hash-verified

27 * @returns {Promise<string[]>}
28 */
29export async function walk(dir, ext) {
30 const itemsInDir = await fs.readdir(dir);
31 const result = [];
32 for (const itemInDir of itemsInDir) {
33 const fullPath = path.join(dir, itemInDir);
34 let stats;
35 try {
36 stats = await fs.stat(fullPath);
37 } catch {
38 continue;
39 }
40 if (stats.isDirectory()) {
41 result.push(...(await walk(fullPath, ext)));
42 } else if (itemInDir.endsWith(ext)) {
43 result.push(fullPath);
44 }
45 }
46 return result;
47}
48
49/**
50 * @param {string} [suffix='']

Callers 8

walkFunction · 0.90
walkDirFunction · 0.90
collectFunction · 0.90
collectViaEventsFunction · 0.90
walker.spec.tsFile · 0.90
cleanupObsoleteDocumentsFunction · 0.90
updateDocumentsFunction · 0.90
syncTranslatedDocumentsFunction · 0.90

Calls 1

pushMethod · 0.80

Tested by 2

collectFunction · 0.72
collectViaEventsFunction · 0.72