From d32287d2111ec7b845e09c7cfe6a5d779c5f3bd1 Mon Sep 17 00:00:00 2001 From: Ryan Clements Date: Fri, 16 Jun 2023 06:43:59 -0400 Subject: fix(ext/node): remove fromFileUrl from "node:path" (#19504) --- ext/node/polyfills/_fs/_fs_exists.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ext/node/polyfills/_fs/_fs_exists.ts') diff --git a/ext/node/polyfills/_fs/_fs_exists.ts b/ext/node/polyfills/_fs/_fs_exists.ts index 37ce599e9..32eb7948a 100644 --- a/ext/node/polyfills/_fs/_fs_exists.ts +++ b/ext/node/polyfills/_fs/_fs_exists.ts @@ -1,5 +1,5 @@ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. -import { fromFileUrl } from "ext:deno_node/path.ts"; +import { pathFromURL } from "ext:deno_web/00_infra.js"; type ExistsCallback = (exists: boolean) => void; @@ -9,7 +9,7 @@ type ExistsCallback = (exists: boolean) => void; * Deprecated in node api */ export function exists(path: string | URL, callback: ExistsCallback) { - path = path instanceof URL ? fromFileUrl(path) : path; + path = path instanceof URL ? pathFromURL(path) : path; Deno.lstat(path).then(() => callback(true), () => callback(false)); } @@ -30,7 +30,7 @@ Object.defineProperty(exists, kCustomPromisifiedSymbol, { * are implemented. See https://github.com/denoland/deno/issues/3403 */ export function existsSync(path: string | URL): boolean { - path = path instanceof URL ? fromFileUrl(path) : path; + path = path instanceof URL ? pathFromURL(path) : path; try { Deno.lstatSync(path); return true; -- cgit v1.2.3