MCPcopy
hub / github.com/webpack/webpack / sendCommand

Method sendCommand

lib/debug/ProfilingPlugin.js:112–126  ·  view source on GitHub ↗

* Returns promise for the result. * @param {string} method method name * @param {EXPECTED_OBJECT=} params params * @returns {Promise<EXPECTED_ANY | void>} Promise for the result

(method, params)

Source from the content-addressed store, hash-verified

110 * @returns {Promise<EXPECTED_ANY | void>} Promise for the result
111 */
112 sendCommand(method, params) {
113 if (this.hasSession()) {
114 return new Promise((res, rej) => {
115 /** @type {Session} */
116 (this.session).post(method, params, (err, params) => {
117 if (err !== null) {
118 rej(err);
119 } else {
120 res(params);
121 }
122 });
123 });
124 }
125 return Promise.resolve();
126 }
127
128 destroy() {
129 if (this.hasSession()) {

Callers 3

startProfilingMethod · 0.95
stopProfilingMethod · 0.95

Calls 2

hasSessionMethod · 0.95
resolveMethod · 0.65

Tested by

no test coverage detected