MCPcopy Create free account
hub / github.com/BYVoid/OpenCC / findFile

Function findFile

plugins/jieba/node/build.js:54–69  ·  view source on GitHub ↗
(dir, filename)

Source from the content-addressed store, hash-verified

52}
53
54function findFile(dir, filename) {
55 const entries = fs.readdirSync(dir, { withFileTypes: true });
56 for (const entry of entries) {
57 const fullPath = path.join(dir, entry.name);
58 if (entry.isFile() && entry.name === filename) {
59 return fullPath;
60 }
61 if (entry.isDirectory()) {
62 const found = findFile(fullPath, filename);
63 if (found) {
64 return found;
65 }
66 }
67 }
68 return null;
69}
70
71const { platform, arch } = parseTarget(process.argv[2]);
72const hostPlatform = os.platform();

Callers 1

build.jsFile · 0.85

Calls 1

joinMethod · 0.45

Tested by

no test coverage detected