diff options
Diffstat (limited to 'std/node/_fs/_fs_copy.ts')
-rw-r--r-- | std/node/_fs/_fs_copy.ts | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/std/node/_fs/_fs_copy.ts b/std/node/_fs/_fs_copy.ts index 4fdc63008..320c2fb3e 100644 --- a/std/node/_fs/_fs_copy.ts +++ b/std/node/_fs/_fs_copy.ts @@ -7,20 +7,9 @@ export function copyFile( destination: string, callback: CallbackWithError ): void { - new Promise(async (resolve, reject) => { - try { - await Deno.copyFile(source, destination); - resolve(); - } catch (err) { - reject(err); - } - }) - .then(() => { - callback(); - }) - .catch((err) => { - callback(err); - }); + Deno.copyFile(source, destination) + .then(() => callback()) + .catch(callback); } export function copyFileSync(source: string, destination: string): void { |