async function throwErrorForUnmatchedPatterns({
	basePath,
	patterns,
	rawPatterns,
	unmatchedPatterns,
}) {
	const pattern = unmatchedPatterns[0];
	const rawPattern = rawPatterns[patterns.indexOf(pattern)];

	const patternHasMatch = await globMatch({
		basePath,
		pattern,
	});

	if (patternHasMatch) {
		throw new AllFilesIgnoredError(rawPattern);
	}

	// if we get here there are truly no matches
	throw new NoFilesFoundError(rawPattern, true);
}
Throws an error for unmatched patterns. The error will only contain information about the first one.
Checks to see if there are any ignored results for a given search.
@param {Object} options The options for this function.
@param {string} options.basePath The directory to search.
@param {Array<string>} options.patterns An array of glob patterns
     that were used in the original search.
@param {Array<string>} options.rawPatterns An array of glob patterns
     as the user inputted them. Used for errors.
@param {Array<string>} options.unmatchedPatterns A non-empty array of absolute path glob patterns
     that were unmatched in the original search.
@returns {Promise<never>} Always throws an error.
@throws {NoFilesFoundError} If the first unmatched pattern
     doesn't match any files even when there are no ignores.
@throws {AllFilesIgnoredError} If the first unmatched pattern
     matches some files when there are no ignores.