core: fix types

This commit is contained in:
undefined committed 2022-10-04 01:38:51 +08:00
1 parent d27a1499d2
commit 1c3dc161b6
13 files changed
+48 -62

No files matched your search

+2 -1
View File
@@ -31,7 +31,8 @@ function locateFile(basePath: string, filenames: string[]) {
return null;
}
const getLoader = (type: string, filename: string) => async function loader(pending: string[], fail: string[], ctx: Context) {
type LoadTask = 'handler' | 'model' | 'addon' | 'lib' | 'script' | 'service';
const getLoader = (type: LoadTask, filename: string) => async function loader(pending: string[], fail: string[], ctx: Context) {
for (const i of pending) {
const p = locateFile(i, [`${filename}.ts`, `${filename}.js`]);
if (p && !fail.includes(i)) {