MCPcopy Create free account
hub / github.com/denoland/std / copy

Function copy

bytes/copy.ts:43–51  ·  view source on GitHub ↗
(src: Uint8Array, dst: Uint8Array, offset = 0)

Source from the content-addressed store, hash-verified

41 * destination array.
42 */
43export function copy(src: Uint8Array, dst: Uint8Array, offset = 0): number {
44 offset = Math.max(0, Math.min(offset, dst.byteLength));
45 const dstBytesAvailable = dst.byteLength - offset;
46 if (src.byteLength > dstBytesAvailable) {
47 src = src.subarray(0, dstBytesAvailable);
48 }
49 dst.set(src, offset);
50 return src.byteLength;
51}

Callers 2

repeatFunction · 0.90
copy_test.tsFile · 0.90

Calls 3

maxMethod · 0.80
minMethod · 0.80
setMethod · 0.65

Tested by

no test coverage detected