diff --git a/lib/client/client.js b/lib/client/client.js index 9d5a638b..0954ca73 100644 --- a/lib/client/client.js +++ b/lib/client/client.js @@ -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)