MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / concat

Function concat

e2e/scenarios/custom-tools.test.ts:18–26  ·  view source on GitHub ↗
(parts: readonly Uint8Array[])

Source from the content-addressed store, hash-verified

16const EXPECTED_GIT_AUTHORIZATION = `Basic ${btoa(`git:${FIXTURE_GIT_TOKEN}`)}`;
17
18const concat = (parts: readonly Uint8Array[]): Uint8Array => {
19 const out = new Uint8Array(parts.reduce((sum, part) => sum + part.length, 0));
20 let offset = 0;
21 for (const part of parts) {
22 out.set(part, offset);
23 offset += part.length;
24 }
25 return out;
26};
27
28const pktLine = (payload: string | Uint8Array): Uint8Array => {
29 const body = typeof payload === "string" ? textEncoder.encode(payload) : payload;

Callers 3

pktLineFunction · 0.70
sideBandFunction · 0.70
advertisementFunction · 0.70

Calls 1

setMethod · 0.80

Tested by

no test coverage detected