index.js
function(host, whitelist, next) {
    var blacklist = this.options.blacklist;
    helper.resolveHost(host, function(err, aRecords, resolvedHost) {
      var inBlacklist = false;
      if (!err) {
        if (whitelist) {
          if (_.intersection(aRecords, whitelist).length ) {
            next(err, [], aRecords);
            return;
          } else {
            for (var i = 0; i < whitelist.length; i++) {
              if (resolvedHost === whitelist[i]) {
                next(err, [], aRecords);
                return;
              }
            }
          }
        }

        inBlacklist = _.intersection(aRecords, blacklist)
      }
      next(err, inBlacklist, aRecords);
    });
  }
function(host, whitelist, next) {
    var blacklist = this.options.blacklist;
    helper.resolveHost(host, function(err, aRecords, resolvedHost) {
      var inBlacklist = false;
      if (!err) {
        if (whitelist) {
          if (_.intersection(aRecords, whitelist).length ) {
            next(err, [], aRecords);
            return;
          } else {
            for (var i = 0; i < whitelist.length; i++) {
              if (resolvedHost === whitelist[i]) {
                next(err, [], aRecords);
                return;
              }
            }
          }
        }

        inBlacklist = _.intersection(aRecords, blacklist)
      }
      next(err, inBlacklist, aRecords);
    });
  }
function ( host , whitelist , next ) { var blacklist = this . options . blacklist ; helper . resolveHost ( host , function ( err , aRecords , resolvedHost ) { var inBlacklist = false ; if ( ! err ) { if ( whitelist ) { if ( _ . intersection ( aRecords , whitelist ) . length ) { next ( err , [ ] , aRecords ) ; return ; } else { for ( var i = 0 ; i < whitelist . length ; i ++ ) { if ( resolvedHost === whitelist [ i ] ) { next ( err , [ ] , aRecords ) ; return ; } } } } inBlacklist = _ . intersection ( aRecords , blacklist ) } next ( err , inBlacklist , aRecords ) ; } ) ; }
tests whether host is in blacklist
tests whether host is in blacklist