lint/test cleanup
This commit is contained in:
parent
2f1b0790f6
commit
bc897f9fd4
|
@ -27,7 +27,8 @@ function ExtendedRequest(options) {
|
||||||
throw new TypeError('options must be an object');
|
throw new TypeError('options must be an object');
|
||||||
if (options.requestName && typeof (options.requestName) !== 'string')
|
if (options.requestName && typeof (options.requestName) !== 'string')
|
||||||
throw new TypeError('options.requestName must be a string');
|
throw new TypeError('options.requestName must be a string');
|
||||||
if (options.requestValue && !(Buffer.isBuffer(options.requestValue) || typeof (options.requestValue) === 'string'))
|
if (options.requestValue && !(Buffer.isBuffer(options.requestValue) ||
|
||||||
|
typeof (options.requestValue) === 'string'))
|
||||||
throw new TypeError('options.requestValue must be a buffer or a string');
|
throw new TypeError('options.requestValue must be a buffer or a string');
|
||||||
} else {
|
} else {
|
||||||
options = {};
|
options = {};
|
||||||
|
@ -37,7 +38,7 @@ function ExtendedRequest(options) {
|
||||||
LDAPMessage.call(this, options);
|
LDAPMessage.call(this, options);
|
||||||
|
|
||||||
this.requestName = options.requestName || '';
|
this.requestName = options.requestName || '';
|
||||||
this.requestValue = options.requestValue || undefined;
|
this.requestValue = options.requestValue;
|
||||||
|
|
||||||
this.__defineGetter__('type', function () { return 'ExtendedRequest'; });
|
this.__defineGetter__('type', function () { return 'ExtendedRequest'; });
|
||||||
this.__defineGetter__('_dn', function () { return this.requestName; });
|
this.__defineGetter__('_dn', function () { return this.requestName; });
|
||||||
|
@ -85,8 +86,9 @@ ExtendedRequest.prototype._toBer = function (ber) {
|
||||||
ber.writeString(this.requestName, 0x80);
|
ber.writeString(this.requestName, 0x80);
|
||||||
if (Buffer.isBuffer(this.requestValue))
|
if (Buffer.isBuffer(this.requestValue))
|
||||||
ber.writeBuffer(this.requestValue, 0x81);
|
ber.writeBuffer(this.requestValue, 0x81);
|
||||||
else
|
else {
|
||||||
ber.writeString(this.requestValue, 0x81);
|
ber.writeString(this.requestValue, 0x81);
|
||||||
|
}
|
||||||
|
|
||||||
return ber;
|
return ber;
|
||||||
};
|
};
|
||||||
|
@ -96,7 +98,8 @@ ExtendedRequest.prototype._json = function (j) {
|
||||||
assert.ok(j);
|
assert.ok(j);
|
||||||
|
|
||||||
j.requestName = this.requestName;
|
j.requestName = this.requestName;
|
||||||
j.requestValue = (Buffer.isBuffer(this.requestValue)) ? this.requestValue.toString('hex') : this.requestValue;
|
j.requestValue = (Buffer.isBuffer(this.requestValue)) ?
|
||||||
|
this.requestValue.toString('hex') : this.requestValue;
|
||||||
|
|
||||||
return j;
|
return j;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue