summaryrefslogtreecommitdiff
path: root/std/examples
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2020-04-25 00:09:14 +0200
committerGitHub <noreply@github.com>2020-04-25 00:09:14 +0200
commit0cb1bb98cc2de8dfe51b7adbe992666936146c90 (patch)
treea50b84ff268732e9db15895b443638ac86657007 /std/examples
parent833539fcafa77f341b74498b37372a61c5f10418 (diff)
BREAKING CHANGE: change order of args in Deno.copy() (#4885)
Diffstat (limited to 'std/examples')
-rw-r--r--std/examples/cat.ts2
-rw-r--r--std/examples/curl.ts2
2 files changed, 2 insertions, 2 deletions
diff --git a/std/examples/cat.ts b/std/examples/cat.ts
index 7b7af3145..cf9a7cb1d 100644
--- a/std/examples/cat.ts
+++ b/std/examples/cat.ts
@@ -2,6 +2,6 @@
const filenames = Deno.args;
for (const filename of filenames) {
const file = await Deno.open(filename);
- await Deno.copy(Deno.stdout, file);
+ await Deno.copy(file, Deno.stdout);
file.close();
}
diff --git a/std/examples/curl.ts b/std/examples/curl.ts
index 44ee66125..a3e8b73db 100644
--- a/std/examples/curl.ts
+++ b/std/examples/curl.ts
@@ -3,7 +3,7 @@ const url_ = Deno.args[0];
const res = await fetch(url_);
// TODO(ry) Re-enable streaming in this example.
-// Originally we did: await Deno.copy(Deno.stdout, res.body);
+// Originally we did: await Deno.copy(res.body, Deno.stdout);
// But maybe more JS-y would be: res.pipeTo(Deno.stdout);
const body = new Uint8Array(await res.arrayBuffer());