<commit_before>export {filterHost};

export default vhosts => {
  if(typeof vhosts === 'string') {
    vhosts = [vhosts];
  }

  vhosts = vhosts.filter(host => typeof host === 'string');

  return (ctx, next) => {
    if(filterHost(vhosts, ctx.hostname)) {
      return next();<commit_msg>Allowed for not filtering virtual hosts if no string or array is passed in or if no strings exist in the passed array<commit_after>export {filterHost};

export default vhosts => {
  if(typeof vhosts === 'string') {
    vhosts = [vhosts];
  }

  if(!Array.isArray(vhosts)) {
    return (ctx, next) => next();
  }

  vhosts = vhosts.filter(host => typeof host === 'string');

  return ({hostname}, next) => {
    if(!vhosts.length) {
      return next();
    }

    if(filterHost(vhosts, hostname)) {
      return next();
{'fraction_non_alphanumeric': 0.15594059405940594, 'fraction_numerical': 0.0, 'mean_word_length': 3.4696132596685083, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3325705', 'n_tokens_mistral': 275, 'n_tokens_neox': 255, 'n_words': 73}