function mapParsers(
  languageForExtension,
  languageForModuleSpecifier,
  parserForLanguage,
  moduleTransforms,
  syncModuleTransforms,
  preferSynchronous,
) {
  moduleTransforms = moduleTransforms || {};
  syncModuleTransforms = syncModuleTransforms || {};
  const languageForExtensionEntries = [];
  const problems = [];
  for (const [extension, language] of entries(languageForExtension)) {
    if (has(parserForLanguage, language)) {
      languageForExtensionEntries.push([extension, language]);
    } else {
      problems.push(`${q(language)} for extension ${q(extension)}`);
    }
  }
  if (problems.length > 0) {
    throw Error(`No parser available for language: ${problems.join(', ')}`);
  }
  return makeExtensionParser(
    /** @type {any} */ (preferSynchronous),
    fromEntries(languageForExtensionEntries),
    languageForModuleSpecifier,
    parserForLanguage,
    moduleTransforms,
    syncModuleTransforms,
  );
}
@param {LanguageForExtension} languageForExtension
@param {LanguageForModuleSpecifier} languageForModuleSpecifier - In a rare case,
the type of a module is implied by package.json and should not be inferred
from its extension.
@param {ParserForLanguage} parserForLanguage
@param {ModuleTransforms} [moduleTransforms]
@param {SyncModuleTransforms} [syncModuleTransforms]
@param {boolean} [preferSynchronous] If `true`, will create a `ParseFn`
@returns {AsyncParseFn|ParseFn}