summaryrefslogtreecommitdiff
path: root/ext/node/polyfills/_fs/_fs_rename.ts
diff options
context:
space:
mode:
authorRyan Clements <ryanclementshax@gmail.com>2023-06-16 06:43:59 -0400
committerGitHub <noreply@github.com>2023-06-16 19:43:59 +0900
commitd32287d2111ec7b845e09c7cfe6a5d779c5f3bd1 (patch)
tree20341750a687b05458a5cae8a634fb3ac79888f9 /ext/node/polyfills/_fs/_fs_rename.ts
parent239dc5e681ad61fb77ed7e0791a8512d6842040b (diff)
fix(ext/node): remove fromFileUrl from "node:path" (#19504)
Diffstat (limited to 'ext/node/polyfills/_fs/_fs_rename.ts')
-rw-r--r--ext/node/polyfills/_fs/_fs_rename.ts10
1 files changed, 5 insertions, 5 deletions
diff --git a/ext/node/polyfills/_fs/_fs_rename.ts b/ext/node/polyfills/_fs/_fs_rename.ts
index 5d87619c7..ff0a7246b 100644
--- a/ext/node/polyfills/_fs/_fs_rename.ts
+++ b/ext/node/polyfills/_fs/_fs_rename.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";
import { promisify } from "ext:deno_node/internal/util.mjs";
export function rename(
@@ -7,8 +7,8 @@ export function rename(
newPath: string | URL,
callback: (err?: Error) => void,
) {
- oldPath = oldPath instanceof URL ? fromFileUrl(oldPath) : oldPath;
- newPath = newPath instanceof URL ? fromFileUrl(newPath) : newPath;
+ oldPath = oldPath instanceof URL ? pathFromURL(oldPath) : oldPath;
+ newPath = newPath instanceof URL ? pathFromURL(newPath) : newPath;
if (!callback) throw new Error("No callback function supplied");
@@ -21,8 +21,8 @@ export const renamePromise = promisify(rename) as (
) => Promise<void>;
export function renameSync(oldPath: string | URL, newPath: string | URL) {
- oldPath = oldPath instanceof URL ? fromFileUrl(oldPath) : oldPath;
- newPath = newPath instanceof URL ? fromFileUrl(newPath) : newPath;
+ oldPath = oldPath instanceof URL ? pathFromURL(oldPath) : oldPath;
+ newPath = newPath instanceof URL ? pathFromURL(newPath) : newPath;
Deno.renameSync(oldPath, newPath);
}