From 0cb1bb98cc2de8dfe51b7adbe992666936146c90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Sat, 25 Apr 2020 00:09:14 +0200 Subject: BREAKING CHANGE: change order of args in Deno.copy() (#4885) --- std/mime/multipart.ts | 4 ++-- std/mime/multipart_test.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'std/mime') diff --git a/std/mime/multipart.ts b/std/mime/multipart.ts index c46948226..709752290 100644 --- a/std/mime/multipart.ts +++ b/std/mime/multipart.ts @@ -308,7 +308,7 @@ export class MultipartReader { } // file let formFile: FormFile | undefined; - const n = await copy(buf, p); + const n = await copy(p, buf); const contentType = p.headers.get("content-type"); assert(contentType != null, "content-type must be set"); if (n > maxMemory) { @@ -573,7 +573,7 @@ export class MultipartWriter { file: Reader ): Promise { const f = await this.createFormFile(field, filename); - await copy(f, file); + await copy(file, f); } private flush(): Promise { diff --git a/std/mime/multipart_test.ts b/std/mime/multipart_test.ts index 8b721a441..aa3b7524e 100644 --- a/std/mime/multipart_test.ts +++ b/std/mime/multipart_test.ts @@ -208,7 +208,7 @@ test({ assert(file.tempfile != null); const f = await open(file.tempfile); const w = new StringWriter(); - await copy(w, f); + await copy(f, w); const json = JSON.parse(w.toString()); assertEquals(json["compilerOptions"]["target"], "es2018"); f.close(); -- cgit v1.2.3