diff --git a/src/util/file_reader.ts b/src/util/file_reader.ts index 2ed3b5ee..d8beeeb1 100644 --- a/src/util/file_reader.ts +++ b/src/util/file_reader.ts @@ -17,7 +17,7 @@ export type FileSource = { export type FileSources = FileSource[]; -export async function collectCustomBehaviors(sources: string[]) { +export async function collectCustomBehaviors(sources: string[]): Promise { const collectedSources: FileSources = []; for (const fileSource of sources) { @@ -33,7 +33,7 @@ export async function collectCustomBehaviors(sources: string[]) { return collectedSources; } -async function collectOnlineBehavior(url: string) { +async function collectOnlineBehavior(url: string): Promise { const filename = crypto.randomBytes(4).toString("hex") + ".js"; const behaviorFilepath = `/app/behaviors/${filename}`; @@ -57,7 +57,7 @@ async function collectOnlineBehavior(url: string) { return []; } -async function collectLocalPathBehaviors(fileOrDir: string, depth = 0) { +async function collectLocalPathBehaviors(fileOrDir: string, depth = 0): Promise { const resolvedPath = path.resolve(fileOrDir); if (depth >= MAX_DEPTH) { @@ -83,7 +83,7 @@ async function collectLocalPathBehaviors(fileOrDir: string, depth = 0) { if (stat.isDirectory()) { const files = await fsp.readdir(resolvedPath); - return files.reduce((acc: FileSources, next: string) => { + return files.reduce((acc: FileSources, next: string) => { const nextPath = path.join(fileOrDir, next); return [...acc, ...collectLocalPathBehaviors(nextPath, depth + 1)]; }, []);