async function createSingleIsIgnoredFunction(ignoreFile, withNodeModules) {
  let content = "";

  if (ignoreFile) {
    content += (await readFile(ignoreFile)) ?? "";
  }

  if (!withNodeModules) {
    content += "\n" + "node_modules";
  }

  if (!content) {
    return;
  }

  const ignore = createIgnore({ allowRelativePaths: true }).add(content);

  return (file) =>
    ignore.checkIgnore(slash(getRelativePath(file, ignoreFile))).ignored;
}
@param {string | URL | undefined} ignoreFile
@param {boolean} [withNodeModules]
@returns {Promise<(file: string | URL) => boolean>}