diff options
author | Ali Hasani <a.hassssani@gmail.com> | 2020-04-20 13:59:37 +0430 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-20 11:29:37 +0200 |
commit | 437e35ca52227337588148a6896040d3fc3f2d54 (patch) | |
tree | c1be28b0ceae5fd4276be087afc686b78eab5629 /std/node/_fs/_fs_copy.ts | |
parent | c1ec042a0011eeba2480b892a335ca7804c59180 (diff) |
Add no-async-promise-executor lint rule (#4809)
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 { |