MCPcopy Create free account
hub / github.com/anomalyco/opencode / comparable

Function comparable

packages/http-recorder/src/socket.ts:51–60  ·  view source on GitHub ↗
(event: WebSocketEvent, asJson: boolean)

Source from the content-addressed store, hash-verified

49}
50
51const comparable = (event: WebSocketEvent, asJson: boolean) => {
52 if (!asJson || event.kind === "binary") return JSON.stringify(canonicalizeJson(event))
53 const decoded = decodeJson(event.body)
54 return JSON.stringify(
55 canonicalizeJson({
56 ...event,
57 body: decoded._tag === "None" ? event.body : canonicalizeJson(decoded.value),
58 }),
59 )
60}
61
62const assertEvent = (actual: WebSocketEvent, expected: WebSocketEvent | undefined, index: number, asJson: boolean) =>
63 Effect.sync(() => {

Callers 1

assertEventFunction · 0.85

Calls 1

canonicalizeJsonFunction · 0.85

Tested by

no test coverage detected