1 |
|
2 |
|
3 | const assert = require('assert-plus')
|
4 | const util = require('util')
|
5 |
|
6 | const LDAPResult = require('./result')
|
7 | const Protocol = require('../protocol')
|
8 |
|
9 |
|
10 |
|
11 | function CompareResponse (options) {
|
12 | options = options || {}
|
13 | assert.object(options)
|
14 |
|
15 | options.protocolOp = Protocol.LDAP_REP_COMPARE
|
16 | LDAPResult.call(this, options)
|
17 | }
|
18 | util.inherits(CompareResponse, LDAPResult)
|
19 |
|
20 | CompareResponse.prototype.end = function (matches) {
|
21 | let status = 0x06
|
22 | if (typeof (matches) === 'boolean') {
|
23 | if (!matches) { status = 0x05 }
|
24 | } else {
|
25 | status = matches
|
26 | }
|
27 |
|
28 | return LDAPResult.prototype.end.call(this, status)
|
29 | }
|
30 |
|
31 |
|
32 |
|
33 | module.exports = CompareResponse
|