From e52047bed7dcce751c5f228e02a588b41429c2a6 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Sun, 8 Aug 2021 16:37:14 -0400 Subject: [PATCH] Update lib/internal/fs/promises.js Co-authored-by: Mestery --- lib/internal/fs/promises.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/internal/fs/promises.js b/lib/internal/fs/promises.js index 69047b0d08e275..e26f1314d155de 100644 --- a/lib/internal/fs/promises.js +++ b/lib/internal/fs/promises.js @@ -441,10 +441,8 @@ async function access(path, mode = F_OK) { async function cp(src, dest, options) { options = validateCpOptions(options); - src = getValidatedPath(src, 'src'); - dest = getValidatedPath(dest, 'dest'); - src = pathModule.toNamespacedPath(src); - dest = pathModule.toNamespacedPath(dest); + src = pathModule.toNamespacedPath(getValidatedPath(src, 'src')); + dest = pathModule.toNamespacedPath(getValidatedPath(dest, 'dest')); return lazyLoadCpPromises()(src, dest, options); }