MCPcopy
hub / github.com/di-sukharev/opencommit / isValidSubprotocol

Function isValidSubprotocol

out/cli.cjs:63085–63097  ·  view source on GitHub ↗
(protocol)

Source from the content-addressed store, hash-verified

63083 dataForEvent = new Uint8Array(data).buffer;
63084 }
63085 }
63086 fireEvent("message", ws, MessageEvent, {
63087 origin: ws[kWebSocketURL].origin,
63088 data: dataForEvent
63089 });
63090 }
63091 function isValidSubprotocol(protocol) {
63092 if (protocol.length === 0) {
63093 return false;
63094 }
63095 for (const char of protocol) {
63096 const code = char.charCodeAt(0);
63097 if (code < 33 || code > 126 || char === "(" || char === ")" || char === "<" || char === ">" || char === "@" || char === "," || char === ";" || char === ":" || char === "\\" || char === '"' || char === "/" || char === "[" || char === "]" || char === "?" || char === "=" || char === "{" || char === "}" || code === 32 || // SP
63098 code === 9) {
63099 return false;
63100 }

Callers 1

constructorMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…