MCPcopy Create free account
hub / github.com/cameri/nostream / onData

Method onData

src/tor/client.ts:118–127  ·  view source on GitHub ↗
(data: Buffer)

Source from the content-addressed store, hash-verified

116 }
117
118 const onData = (data: Buffer) => {
119 buf += data.toString()
120 if (!this.isCompleteTorReply(buf)) {
121 return
122 }
123
124 cleanup()
125 if (/^250/.test(buf)) { resolve(buf) }
126 else { reject(new Error(buf.trim())) }
127 }
128
129 socket.on('data', onData)
130 socket.on('error', onError)

Callers

nothing calls this directly

Calls 2

isCompleteTorReplyMethod · 0.95
toStringMethod · 0.80

Tested by

no test coverage detected