11 lines
192 B
TypeScript
11 lines
192 B
TypeScript
import { stat } from "node:fs/promises"
|
|
|
|
export async function isFile(path: string) {
|
|
try {
|
|
const result = await stat(path)
|
|
return result.isFile()
|
|
} catch {
|
|
return false
|
|
}
|
|
}
|