UNPKG

340 BJavaScriptView Raw
1const evaluate = require('./evaluate')
2
3module.exports = (files, context, getExcludedPatterns) => {
4 return Object.keys(files).filter(pattern => {
5 let condition = files[pattern]
6 if (typeof condition === 'string') {
7 condition = evaluate(condition, context)
8 }
9 return getExcludedPatterns ? !condition : condition
10 })
11}