- if (this.responseHandlers.has(uuid) === true) {
- const res = this.responseHandlers.get(uuid) as ServerResponse;
- res.writeHead(this.responseStatusToStatusCode(payload.status), {
- 'Content-Type': 'application/json',
- });
- res.end(JSON.stringify(payload));
- this.responseHandlers.delete(uuid);
+ if (this.hasResponseHandler(uuid)) {
+ const res = this.responseHandlers.get(uuid) as ServerResponse
+ res
+ .writeHead(this.responseStatusToStatusCode(payload.status), {
+ 'Content-Type': 'application/json'
+ })
+ .end(JSON.stringify(payload))