summaryrefslogtreecommitdiff
path: root/ext/node/polyfills/_fs/_fs_ftruncate.ts
diff options
context:
space:
mode:
authorAsher Gomez <ashersaupingomez@gmail.com>2024-01-25 01:12:22 +1100
committerGitHub <noreply@github.com>2024-01-24 15:12:22 +0100
commit4af121687cb4c26f4a2f3e4ad266490d8faa3d2d (patch)
tree97647feb4b94dd91d84e75499712d406cf151cf3 /ext/node/polyfills/_fs/_fs_ftruncate.ts
parent064a6c048ab420302cbb822bedd3fc365b4259a7 (diff)
feat: deprecate `Deno.ftruncate()` and `Deno.ftruncateSync()` (#22069)
For removal in Deno 2.0.
Diffstat (limited to 'ext/node/polyfills/_fs/_fs_ftruncate.ts')
-rw-r--r--ext/node/polyfills/_fs/_fs_ftruncate.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/node/polyfills/_fs/_fs_ftruncate.ts b/ext/node/polyfills/_fs/_fs_ftruncate.ts
index 8a00cac4c..71186e868 100644
--- a/ext/node/polyfills/_fs/_fs_ftruncate.ts
+++ b/ext/node/polyfills/_fs/_fs_ftruncate.ts
@@ -4,6 +4,7 @@
// deno-lint-ignore-file prefer-primordials
import { CallbackWithError } from "ext:deno_node/_fs/_fs_common.ts";
+import { FsFile } from "ext:deno_fs/30_fs.js";
export function ftruncate(
fd: number,
@@ -19,9 +20,9 @@ export function ftruncate(
if (!callback) throw new Error("No callback function supplied");
- Deno.ftruncate(fd, len).then(() => callback(null), callback);
+ new FsFile(fd).truncate(len).then(() => callback(null), callback);
}
export function ftruncateSync(fd: number, len?: number) {
- Deno.ftruncateSync(fd, len);
+ new FsFile(fd).truncateSync(len);
}