Creates the function which checks whether a file path is matched with the given pattern or not.

@param {string[]} includePatterns - The glob patterns to include files.
@param {string[]} excludePatterns - The glob patterns to exclude files.
@returns {function} Created predicate function.
function createMatch(includePatterns, excludePatterns) {
    const include = includePatterns.map(pattern => new Minimatch(pattern))
    const exclude = excludePatterns.map(pattern => new Minimatch(pattern))

    return filePath =>
        include.some(m => m.match(filePath)) &&
        !exclude.some(m => m.match(filePath))
}