lib/utils.js
function isMatchRule(req, pathname, rule) {
  if (typeof rule === 'string') {
    return pathname.indexOf(rule) > -1;
  } else if (rule instanceof RegExp) {
    return rule.test(pathname);
  } else if (typeof rule === 'function') {
    return rule(pathname, req);
  }
}
function isMatchRule(req, pathname, rule) {
  if (typeof rule === 'string') {
    return pathname.indexOf(rule) > -1;
  } else if (rule instanceof RegExp) {
    return rule.test(pathname);
  } else if (typeof rule === 'function') {
    return rule(pathname, req);
  }
}
function isMatchRule ( req , pathname , rule ) { if ( typeof rule === 'string' ) { return pathname . indexOf ( rule ) > - 1 ; } else if ( rule instanceof RegExp ) { return rule . test ( pathname ) ; } else if ( typeof rule === 'function' ) { return rule ( pathname , req ) ; } }
Return `true` when pathname match the rule.

@param req
@param pathname
@param rule
@returns {*}
Return true when pathname match the rule .