MCPcopy Index your code
hub / github.com/nodejs/node / _sendMessage

Method _sendMessage

test/common/inspector-helper.js:202–215  ·  view source on GitHub ↗
(message)

Source from the content-addressed store, hash-verified

200 }
201
202 _sendMessage(message) {
203 const msg = JSON.parse(JSON.stringify(message)); // Clone!
204 msg.id = this._nextId++;
205 if (DEBUG)
206 console.log('[sent]', JSON.stringify(msg));
207
208 const responsePromise = new Promise((resolve, reject) => {
209 this._commandResponsePromises.set(msg.id, { resolve, reject });
210 });
211
212 return new Promise(
213 (resolve) => this._socket.write(formatWSFrame(msg), resolve))
214 .then(() => responsePromise);
215 }
216
217 send(commands) {
218 if (Array.isArray(commands)) {

Callers 1

sendMethod · 0.95

Calls 6

formatWSFrameFunction · 0.85
parseMethod · 0.65
logMethod · 0.45
setMethod · 0.45
thenMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected