MCPcopy Create free account
hub / github.com/bearlyai/OpenADE / rawText

Function rawText

projects/runtime-node/src/server.ts:33–38  ·  view source on GitHub ↗
(data: RawData)

Source from the content-addressed store, hash-verified

31}
32
33function rawText(data: RawData): string {
34 if (typeof data === "string") return data
35 if (Buffer.isBuffer(data)) return data.toString("utf8")
36 if (Array.isArray(data)) return Buffer.concat(data).toString("utf8")
37 return Buffer.from(data).toString("utf8")
38}
39
40function tokenFromRequest(request: http.IncomingMessage): string | null {
41 const protocolHeader = request.headers["sec-websocket-protocol"]

Callers 1

attachSocketFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected