From 3c5138de26e54d9c7dbcc16515b6df044668dfdb Mon Sep 17 00:00:00 2001 From: Robert Kawecki Date: Thu, 16 Jul 2020 14:32:04 +0200 Subject: [PATCH] Remove instanceof check in filter#toBer mixin For #629 --- lib/filters/filter.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/filters/filter.js b/lib/filters/filter.js index 4c7e4ba..612b7fd 100644 --- a/lib/filters/filter.js +++ b/lib/filters/filter.js @@ -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, @@ -40,7 +36,7 @@ function isFilter (filter) { function mixin (target) { target.prototype.toBer = function toBer (ber) { - if (!ber || !(ber instanceof BerWriter)) { throw new TypeError('ber (BerWriter) required') } + if (!ber) { throw new TypeError('ber (BerWriter) required') } ber.startSequence(TYPES[this.type]) ber = this._toBer(ber)