From 9ded17d722b8da124987cdf16976589a46f2d3f5 Mon Sep 17 00:00:00 2001 From: Marcos Casagrande Date: Thu, 30 Apr 2020 22:39:25 +0200 Subject: BREAKING: reorder std/io/utils copyBytes arguments (#5022) --- std/io/util.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'std/io/util.ts') diff --git a/std/io/util.ts b/std/io/util.ts index 18ddb4def..237747a89 100644 --- a/std/io/util.ts +++ b/std/io/util.ts @@ -9,12 +9,12 @@ import { encode } from "../encoding/utf8.ts"; * Copy bytes from one Uint8Array to another. Bytes from `src` which don't fit * into `dst` will not be copied. * - * @param dst Destination byte array * @param src Source byte array + * @param dst Destination byte array * @param off Offset into `dst` at which to begin writing values from `src`. * @return number of bytes copied */ -export function copyBytes(dst: Uint8Array, src: Uint8Array, off = 0): number { +export function copyBytes(src: Uint8Array, dst: Uint8Array, off = 0): number { off = Math.max(0, Math.min(off, dst.byteLength)); const dstBytesAvailable = dst.byteLength - off; if (src.byteLength > dstBytesAvailable) { -- cgit v1.2.3