Move isFile into util
That allows its use in entry.ts as well.
This commit is contained in:
@ -261,3 +261,12 @@ export function canConnect(path: string): Promise<boolean> {
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
export const isFile = async (path: string): Promise<boolean> => {
|
||||
try {
|
||||
const stat = await fs.stat(path)
|
||||
return stat.isFile()
|
||||
} catch (error) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user