summaryrefslogtreecommitdiff
path: root/ext/node/polyfills/_fs/_fs_truncate.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_truncate.ts
parent239dc5e681ad61fb77ed7e0791a8512d6842040b (diff)
fix(ext/node): remove fromFileUrl from "node:path" (#19504)
Diffstat (limited to 'ext/node/polyfills/_fs/_fs_truncate.ts')
-rw-r--r--ext/node/polyfills/_fs/_fs_truncate.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/node/polyfills/_fs/_fs_truncate.ts b/ext/node/polyfills/_fs/_fs_truncate.ts
index b6d39352b..596c11211 100644
--- a/ext/node/polyfills/_fs/_fs_truncate.ts
+++ b/ext/node/polyfills/_fs/_fs_truncate.ts
@@ -1,6 +1,6 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
import { CallbackWithError } from "ext:deno_node/_fs/_fs_common.ts";
-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 truncate(
@@ -8,7 +8,7 @@ export function truncate(
lenOrCallback: number | CallbackWithError,
maybeCallback?: CallbackWithError,
) {
- path = path instanceof URL ? fromFileUrl(path) : path;
+ path = path instanceof URL ? pathFromURL(path) : path;
const len: number | undefined = typeof lenOrCallback === "number"
? lenOrCallback
: undefined;
@@ -27,7 +27,7 @@ export const truncatePromise = promisify(truncate) as (
) => Promise<void>;
export function truncateSync(path: string | URL, len?: number) {
- path = path instanceof URL ? fromFileUrl(path) : path;
+ path = path instanceof URL ? pathFromURL(path) : path;
Deno.truncateSync(path, len);
}