summaryrefslogtreecommitdiff
path: root/std/node/_fs/_fs_copy.ts
diff options
context:
space:
mode:
authorAli Hasani <a.hassssani@gmail.com>2020-04-20 13:59:37 +0430
committerGitHub <noreply@github.com>2020-04-20 11:29:37 +0200
commit437e35ca52227337588148a6896040d3fc3f2d54 (patch)
treec1be28b0ceae5fd4276be087afc686b78eab5629 /std/node/_fs/_fs_copy.ts
parentc1ec042a0011eeba2480b892a335ca7804c59180 (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.ts17
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 {