INNER CODE UNIT · TypeScript
getPathStats
cloudflare/workers-sdk · packages/autoconfig/src/details/index.ts:56
async function getPathStats(path: string): Promise<Stats | undefined> {
try {
return await stat(path);
} catch (error) {
if (isExpectedFileSystemError(error)) {
return undefined;
}
throw error;
}
}
async function hasIndexHtml(dir: string): Promise<boolean> {
const stats = await getPathStats(join(dir, "index.html"));
if (!stats?.isFile()) {
return false;
}
try {