Skip to content

Commit 3ed2d4f

Browse files
committed
Fix safeReadFile so it's safe
1 parent 8f0bcc2 commit 3ed2d4f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/utils/fs.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ export async function readFileUtf8(
5454
} as ReadFileOptions)) as string
5555
}
5656

57-
export function safeReadFile(
57+
export async function safeReadFile(
5858
...args: Parameters<typeof fs.readFile>
59-
): ReturnType<typeof fs.readFile> | undefined {
59+
): Promise<ReturnType<typeof fs.readFile> | undefined> {
6060
try {
61-
return fs.readFile(...args)
61+
return await fs.readFile(...args)
6262
} catch {}
6363
return undefined
6464
}

0 commit comments

Comments
 (0)