code: function isActionAllowed(_ref) {
    var predicate = _ref.predicate,
        blacklist = _ref.blacklist,
        whitelist = _ref.whitelist;
  
    var allowed = function allowed() {
      return true;
    };
  
    if (predicate && typeof predicate === 'function') {
      allowed = predicate;
    } else if (Array.isArray(blacklist)) {
      allowed = function allowed(type) {
        return blacklist.indexOf(type) < 0;
      };
    } else if (Array.isArray(whitelist)) {
      allowed = function allowed(type) {
        return whitelist.indexOf(type) >= 0;
      };
    }
    return allowed;
  }
docs: export for test