import { IsomorphicRollupFs } from "../fs-iface"; export const fileExists = async (filePath: string, fs: IsomorphicRollupFs) => { try { const res = await fs.stat(filePath); return res.isFile(); } catch { return false; } }; export async function resolveSymlink(path: string, fs: IsomorphicRollupFs) { return (await fileExists(path, fs)) ? fs.realpath(path) : path; }