main repo

This commit is contained in:
Basilosaurusrex
2025-11-24 18:09:40 +01:00
parent b636ee5e70
commit f027651f9b
34146 changed files with 4436636 additions and 0 deletions

28
node_modules/next/dist/esm/lib/file-exists.js generated vendored Normal file
View File

@@ -0,0 +1,28 @@
import { constants, promises } from "fs";
import isError from "./is-error";
export var FileType;
(function(FileType) {
FileType["File"] = "file";
FileType["Directory"] = "directory";
})(FileType || (FileType = {}));
export async function fileExists(fileName, type) {
try {
if (type === "file") {
const stats = await promises.stat(fileName);
return stats.isFile();
} else if (type === "directory") {
const stats = await promises.stat(fileName);
return stats.isDirectory();
} else {
await promises.access(fileName, constants.F_OK);
}
return true;
} catch (err) {
if (isError(err) && (err.code === "ENOENT" || err.code === "ENAMETOOLONG")) {
return false;
}
throw err;
}
}
//# sourceMappingURL=file-exists.js.map