import { fromFileUrl } from "../path.ts";
type ExistsCallback = (exists: boolean) => void;
export function exists(path: string | URL, callback: ExistsCallback) { path = path instanceof URL ? fromFileUrl(path) : path; Deno.lstat(path).then(() => callback(true), () => callback(false));}
const kCustomPromisifiedSymbol = Symbol.for("nodejs.util.promisify.custom");Object.defineProperty(exists, kCustomPromisifiedSymbol, { value: (path: string | URL) => { return new Promise((resolve) => { exists(path, (exists) => resolve(exists)); }); },});
export function existsSync(path: string | URL): boolean { path = path instanceof URL ? fromFileUrl(path) : path; try { Deno.lstatSync(path); return true; } catch (_err) { return false; }}