shouldSkip.js 341 B

1234567891011
  1. const matchPatterns = require('./matchPatterns');
  2. module.exports = function shouldSkip({ exclude = [], include = [] }, text) {
  3. if (!include.length && !exclude.length) return false;
  4. if (include.length && matchPatterns(include, text)) return false;
  5. if (exclude.length && !matchPatterns(exclude, text)) return false;
  6. return true;
  7. };