summaryrefslogtreecommitdiff
path: root/ext/node/polyfills/_fs/_fs_truncate.ts
diff options
context:
space:
mode:
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);
}