Merge branch 'master' into use-dependabot
This commit is contained in:
commit
41d17988de
|
@ -2,14 +2,10 @@
|
|||
|
||||
// var assert = require('assert')
|
||||
|
||||
var asn1 = require('asn1')
|
||||
|
||||
var Protocol = require('../protocol')
|
||||
|
||||
/// --- Globals
|
||||
|
||||
var BerWriter = asn1.BerWriter
|
||||
|
||||
var TYPES = {
|
||||
and: Protocol.FILTER_AND,
|
||||
or: Protocol.FILTER_OR,
|
||||
|
@ -38,9 +34,18 @@ function isFilter (filter) {
|
|||
return false
|
||||
}
|
||||
|
||||
function isBerWriter (ber) {
|
||||
return Boolean(
|
||||
ber &&
|
||||
typeof (ber) === 'object' &&
|
||||
typeof (ber.startSequence) === 'function' &&
|
||||
typeof (ber.endSequence) === 'function'
|
||||
)
|
||||
}
|
||||
|
||||
function mixin (target) {
|
||||
target.prototype.toBer = function toBer (ber) {
|
||||
if (!ber || !(ber instanceof BerWriter)) { throw new TypeError('ber (BerWriter) required') }
|
||||
if (isBerWriter(ber) === false) { throw new TypeError('ber (BerWriter) required') }
|
||||
|
||||
ber.startSequence(TYPES[this.type])
|
||||
ber = this._toBer(ber)
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
"name": "ldapjs",
|
||||
"homepage": "http://ldapjs.org",
|
||||
"description": "LDAP client and server APIs",
|
||||
"version": "2.0.0",
|
||||
"version": "2.1.0",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
|
Loading…
Reference in New Issue