const { lstat, lstatSync, DenoError, ErrorKind } = Deno;export async function exists(filePath: string): Promise<boolean> { return lstat(filePath) .then((): boolean => true) .catch((err: Error): boolean => { if (err instanceof DenoError) { if (err.kind === ErrorKind.NotFound) { return false; } }
throw err; });}
export function existsSync(filePath: string): boolean { try { lstatSync(filePath); return true; } catch (err) { if (err instanceof DenoError) { if (err.kind === ErrorKind.NotFound) { return false; } } throw err; }}