(method, params = {})
| 119 | }) |
| 120 | } |
| 121 | send(method, params = {}) { const id = this.id++; return new Promise((res, rej) => { this.pending.set(id, { resolve: res, reject: rej }); this.ws.send(JSON.stringify({ id, method, params })) }) } |
| 122 | on(method, l) { const a = this.listeners.get(method) ?? []; a.push(l); this.listeners.set(method, a) } |
| 123 | close() { this.ws?.terminate?.(); this.ws?.close() } |
| 124 | } |
no outgoing calls
no test coverage detected