(basePath: string, filenames: string[])
| 12 | const logger = new Logger('common'); |
| 13 | |
| 14 | function 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 | |
| 22 | type LoadTask = 'model' | 'addon' | 'service'; |
| 23 | const getLoader = (type: LoadTask, filename: string) => async function loader(pending: Record<string, string>, fail: string[], ctx: Context) { |