diff options
author | Ryan Clements <ryanclementshax@gmail.com> | 2023-06-16 06:43:59 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-16 19:43:59 +0900 |
commit | d32287d2111ec7b845e09c7cfe6a5d779c5f3bd1 (patch) | |
tree | 20341750a687b05458a5cae8a634fb3ac79888f9 /ext/node/polyfills/_fs/_fs_readFile.ts | |
parent | 239dc5e681ad61fb77ed7e0791a8512d6842040b (diff) |
fix(ext/node): remove fromFileUrl from "node:path" (#19504)
Diffstat (limited to 'ext/node/polyfills/_fs/_fs_readFile.ts')
-rw-r--r-- | ext/node/polyfills/_fs/_fs_readFile.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/node/polyfills/_fs/_fs_readFile.ts b/ext/node/polyfills/_fs/_fs_readFile.ts index b3bd5b94c..04e42e391 100644 --- a/ext/node/polyfills/_fs/_fs_readFile.ts +++ b/ext/node/polyfills/_fs/_fs_readFile.ts @@ -8,7 +8,7 @@ import { import { Buffer } from "ext:deno_node/buffer.ts"; import { readAll } from "ext:deno_io/12_io.js"; import { FileHandle } from "ext:deno_node/internal/fs/handle.ts"; -import { fromFileUrl } from "ext:deno_node/path.ts"; +import { pathFromURL } from "ext:deno_web/00_infra.js"; import { BinaryEncodings, Encodings, @@ -57,7 +57,7 @@ export function readFile( optOrCallback?: FileOptionsArgument | Callback | null | undefined, callback?: Callback, ) { - path = path instanceof URL ? fromFileUrl(path) : path; + path = path instanceof URL ? pathFromURL(path) : path; let cb: Callback | undefined; if (typeof optOrCallback === "function") { cb = optOrCallback; @@ -105,7 +105,7 @@ export function readFileSync( path: string | URL, opt?: FileOptionsArgument, ): string | Buffer { - path = path instanceof URL ? fromFileUrl(path) : path; + path = path instanceof URL ? pathFromURL(path) : path; const data = Deno.readFileSync(path); const encoding = getEncoding(opt); if (encoding && encoding !== "binary") { |