index.js
function checkPattern(file, blackList, whiteList){

  if (util.isRegExp(blackList) && blackList.test(file)) {
    return false;
  }

  if (util.isRegExp(whiteList)) {
    if (whiteList.test(file)) {
      return true;
    }
    return false;
  }

  return true;
}
function checkPattern(file, blackList, whiteList){

  if (util.isRegExp(blackList) && blackList.test(file)) {
    return false;
  }

  if (util.isRegExp(whiteList)) {
    if (whiteList.test(file)) {
      return true;
    }
    return false;
  }

  return true;
}
Helper functions
 
Checks blackList- and whitList-regex against
the given file name and returns if this file can
be deleted.

@param string file - the gile name
@param regex|undefined blackList
@param regex|undefined - whiteList
@returns {boolean}