import { bytes } from "https://deno.land/x/discord_rpc_deno@v1.1.4/deps.ts";
const { repeat } = bytes;
Returns a new byte slice composed of count
repetitions of the source
array.
Examples
Basic usage
Basic usage
import { repeat } from "https://deno.land/std@0.224.0/bytes/repeat.ts";
const source = new Uint8Array([0, 1, 2]);
repeat(source, 3); // Uint8Array(9) [0, 1, 2, 0, 1, 2, 0, 1, 2]
repeat(source, 0); // Uint8Array(0) []
repeat(source, -1); // Throws `RangeError`