(source: Uint8Array, count: number)
| 34 | * ``` |
| 35 | */ |
| 36 | export function repeat(source: Uint8Array, count: number): Uint8Array_ { |
| 37 | if (count < 0 || !Number.isInteger(count)) { |
| 38 | throw new RangeError("Count must be a non-negative integer"); |
| 39 | } |
| 40 | |
| 41 | const repeated = new Uint8Array(source.length * count); |
| 42 | let offset = 0; |
| 43 | |
| 44 | while (offset < repeated.length) { |
| 45 | offset += copy(source, repeated, offset); |
| 46 | } |
| 47 | |
| 48 | return repeated; |
| 49 | } |
no test coverage detected