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

Function pktLine

packages/plugins/apps/src/git-client/pktline.ts:8–16  ·  view source on GitHub ↗
(payload: string | Uint8Array)

Source from the content-addressed store, hash-verified

6const te = new TextEncoder();
7
8export function pktLine(payload: string | Uint8Array): Uint8Array {
9 const body = typeof payload === "string" ? te.encode(payload) : payload;
10 const len = body.length + 4;
11 const hdr = te.encode(len.toString(16).padStart(4, "0"));
12 const out = new Uint8Array(hdr.length + body.length);
13 out.set(hdr, 0);
14 out.set(body, hdr.length);
15 return out;
16}
17
18export const FLUSH = te.encode("0000");
19export const DELIM = te.encode("0001");

Callers 6

advertisementFunction · 0.90
sideBandFunction · 0.90
sideBandFunction · 0.90
advertisementFunction · 0.90
app-source.test.tsFile · 0.90
buildV1RequestFunction · 0.90

Calls 2

toStringMethod · 0.80
setMethod · 0.80

Tested by 4

advertisementFunction · 0.72
sideBandFunction · 0.72
sideBandFunction · 0.72
advertisementFunction · 0.72