Skip to content
This repository has been archived by the owner on Feb 4, 2022. It is now read-only.

Commit

Permalink
feat(sessions): add equality operator to ease readability
Browse files Browse the repository at this point in the history
  • Loading branch information
mbroadst committed Nov 21, 2017
1 parent c1b5e04 commit 6510d7d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/sessions.js
Expand Up @@ -84,6 +84,17 @@ class ClientSession extends EventEmitter {
this.operationTime = operationTime;
}
}

/**
* Used to determine if this session equals another
*/
equals(session) {
if (!(session instanceof ClientSession)) {
return false;
}

return this.id.id.buffer.equals(session.id.id.buffer);
}
}

Object.defineProperty(ClientSession.prototype, 'id', {
Expand Down

0 comments on commit 6510d7d

Please sign in to comment.