Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
 match event name to `instanceof`, not to `constructor.name`
  • Loading branch information
hillar authored Oct 25, 2021
1 parent b64ed9f commit 1dd06d2
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/client/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -1205,8 +1205,7 @@ Client.prototype._sendSocket = function _sendSocket (message,
if (expect === 'abandon') { return sendResult('end', null) }

if (msg instanceof SearchEntry || msg instanceof SearchReference) {
let event = msg.constructor.name
event = event[0].toLowerCase() + event.slice(1)
const event = msg instanceof SearchEntry ? 'searchEntry' : 'searchReference'
return sendResult(event, msg)
} else {
tracker.remove(message.messageID)
Expand Down

0 comments on commit 1dd06d2

Please sign in to comment.