MCPcopy Create free account
hub / github.com/hydro-dev/Hydro / locateFile

Function locateFile

packages/hydrooj/src/entry/common.ts:14–20  ·  view source on GitHub ↗
(basePath: string, filenames: string[])

Source from the content-addressed store, hash-verified

12const logger = new Logger('common');
13
14function locateFile(basePath: string, filenames: string[]) {
15 for (const i of filenames) {
16 const p = path.resolve(basePath, i);
17 if (fs.existsSync(p)) return p;
18 }
19 return null;
20}
21
22type LoadTask = 'model' | 'addon' | 'service';
23const getLoader = (type: LoadTask, filename: string) => async function loader(pending: Record<string, string>, fail: string[], ctx: Context) {

Callers 2

getLoaderFunction · 0.70
localeFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected