(t2, e)
| 1213 | 3 !== this._mode ? this.fetch(this._url, JSON.stringify(s)).catch((t3) => this.onError(t3)).then((t3) => this.result(t3, s)) : this._socket.send(JSON.stringify({ action: "call", body: s })); |
| 1214 | } |
| 1215 | result(t2, e) { |
| 1216 | const s = {}; |
| 1217 | if (t2) |
| 1218 | for (let e2 = 0; e2 < t2.length; e2++) |
| 1219 | s[t2[e2].id] = t2[e2]; |
| 1220 | else |
| 1221 | for (let t3 = 0; t3 < e.length; t3++) |
| 1222 | s[e[t3].id] = { id: e[t3].id, error: "Network Error", data: null }; |
| 1223 | for (let t3 = this._queue.length - 1; t3 >= 0; t3--) { |
| 1224 | const e2 = this._queue[t3], i = s[e2.data.id]; |
| 1225 | i && (this.onResponse(e2, i), i.error ? e2.reject(i.error) : e2.resolve(i.data), this._queue.splice(t3, 1)); |
| 1226 | } |
| 1227 | } |
| 1228 | on(t2, e) { |
| 1229 | const s = this._uid(); |
| 1230 | let i = this._events[t2]; |
no test coverage detected