summaryrefslogtreecommitdiff
path: root/ext/node/polyfills/_fs
diff options
context:
space:
mode:
Diffstat (limited to 'ext/node/polyfills/_fs')
-rw-r--r--ext/node/polyfills/_fs/_fs_exists.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/node/polyfills/_fs/_fs_exists.ts b/ext/node/polyfills/_fs/_fs_exists.ts
index 57df1f07c..b5bbe235a 100644
--- a/ext/node/polyfills/_fs/_fs_exists.ts
+++ b/ext/node/polyfills/_fs/_fs_exists.ts
@@ -3,7 +3,7 @@
// TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials
-import { op_node_fs_exists_sync } from "ext:core/ops";
+import { op_node_fs_exists, op_node_fs_exists_sync } from "ext:core/ops";
import { pathFromURL } from "ext:deno_web/00_infra.js";
@@ -16,7 +16,7 @@ type ExistsCallback = (exists: boolean) => void;
*/
export function exists(path: string | URL, callback: ExistsCallback) {
path = path instanceof URL ? pathFromURL(path) : path;
- Deno.lstat(path).then(() => callback(true), () => callback(false));
+ op_node_fs_exists(path).then(callback);
}
// The callback of fs.exists doesn't have standard callback signature.