parent
8b70279c57
commit
3c5138de26
|
@ -2,14 +2,10 @@
|
||||||
|
|
||||||
// var assert = require('assert')
|
// var assert = require('assert')
|
||||||
|
|
||||||
var asn1 = require('asn1')
|
|
||||||
|
|
||||||
var Protocol = require('../protocol')
|
var Protocol = require('../protocol')
|
||||||
|
|
||||||
/// --- Globals
|
/// --- Globals
|
||||||
|
|
||||||
var BerWriter = asn1.BerWriter
|
|
||||||
|
|
||||||
var TYPES = {
|
var TYPES = {
|
||||||
and: Protocol.FILTER_AND,
|
and: Protocol.FILTER_AND,
|
||||||
or: Protocol.FILTER_OR,
|
or: Protocol.FILTER_OR,
|
||||||
|
@ -40,7 +36,7 @@ function isFilter (filter) {
|
||||||
|
|
||||||
function mixin (target) {
|
function mixin (target) {
|
||||||
target.prototype.toBer = function toBer (ber) {
|
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.startSequence(TYPES[this.type])
|
||||||
ber = this._toBer(ber)
|
ber = this._toBer(ber)
|
||||||
|
|
Loading…
Reference in New Issue