function getExportSpecifierRootFile(matchSubclassesExportSpecifier, refFindExportsResult) {
  /* eslint-disable arrow-body-style */
  /** @type {RootFile} */
  let rootFile;
  refFindExportsResult.queryOutput.some(exportEntry => {
    return exportEntry.result.some(exportEntryResult => {
      if (!exportEntryResult.exportSpecifiers) {
        return false;
      }
      /** @type {RootFile} */
      exportEntryResult.exportSpecifiers.some(exportSpecifierString => {
        const { name, filePath } = matchSubclassesExportSpecifier;
        if (name === exportSpecifierString && filePath === exportEntry.file) {
          const entry = exportEntryResult.rootFileMap.find(
            rfEntry => rfEntry.currentFileSpecifier === name,
          );
          if (entry) {
            rootFile = entry.rootFile;
            if (rootFile.file === '[current]') {
              rootFile.file = filePath;
            }
          }
        }
        return false;
      });
      return Boolean(rootFile);
    });
  });
  return rootFile;
  /* eslint-enable arrow-body-style */
}
@param {MatchedExportSpecifier} matchSubclassesExportSpecifier
@param {FindExportsAnalyzerResult} refFindExportsResult
@returns {RootFile|undefined}