summaryrefslogtreecommitdiff
path: root/ext/node/polyfills/_fs/_fs_cp.js
diff options
context:
space:
mode:
authorKenta Moriuchi <moriken@kimamass.com>2024-01-11 07:37:25 +0900
committerGitHub <noreply@github.com>2024-01-10 15:37:25 -0700
commit515a34b4de222e35c7ade1b92614d746e73d4c2e (patch)
tree8284201fc826a33f12597959a8a8be14e0f524bd /ext/node/polyfills/_fs/_fs_cp.js
parentd4893eb51a01c5a692d8ca74a3b8ff95c5fd1d9f (diff)
refactor: use `core.ensureFastOps()` (#21888)
Diffstat (limited to 'ext/node/polyfills/_fs/_fs_cp.js')
-rw-r--r--ext/node/polyfills/_fs/_fs_cp.js12
1 files changed, 7 insertions, 5 deletions
diff --git a/ext/node/polyfills/_fs/_fs_cp.js b/ext/node/polyfills/_fs/_fs_cp.js
index 245e3c76b..283b4f542 100644
--- a/ext/node/polyfills/_fs/_fs_cp.js
+++ b/ext/node/polyfills/_fs/_fs_cp.js
@@ -2,22 +2,24 @@
// deno-lint-ignore-file prefer-primordials
+import { core } from "ext:core/mod.js";
+const {
+ op_node_cp,
+ op_node_cp_sync,
+} = core.ensureFastOps();
+
import {
getValidatedPath,
validateCpOptions,
} from "ext:deno_node/internal/fs/utils.mjs";
import { promisify } from "ext:deno_node/internal/util.mjs";
-const core = globalThis.__bootstrap.core;
-const ops = core.ops;
-const { op_node_cp } = core.ensureFastOps();
-
export function cpSync(src, dest, options) {
validateCpOptions(options);
const srcPath = getValidatedPath(src, "src");
const destPath = getValidatedPath(dest, "dest");
- ops.op_node_cp_sync(srcPath, destPath);
+ op_node_cp_sync(srcPath, destPath);
}
export function cp(src, dest, options, callback) {