function getSearchFunction(stopDirectory) {
  stopDirectory = stopDirectory ? path.resolve(stopDirectory) : undefined;

  if (!searchCache.has(stopDirectory)) {
    const searcher = getConfigSearcher(stopDirectory);
    const searchFunction = searcher.search.bind(searcher);
    searchCache.set(stopDirectory, searchFunction);
  }

  return searchCache.get(stopDirectory);
}
@param {string} stopDirectory
@returns {FileSearcher["search"]}