function attachModuleSymbols(doclets, modules) {
  const symbols = {};

  // build a lookup table
  doclets.forEach(function (symbol) {
    symbols[symbol.longname] = symbol;
  });

  modules.forEach(function (module) {
    if (symbols[module.longname]) {
      module.module = symbols[module.longname];
      module.module.name =
        module.module.name.replace('module:', 'require("') + '")';
    }
  });
}
Look for classes or functions with the same name as modules (which indicates that the module
exports only that class or function), then attach the classes or functions to the `module`
property of the appropriate module doclets. The name of each class or function is also updated
for display purposes. This function mutates the original arrays.

@private
@param {Array<module:jsdoc/doclet.Doclet>} doclets The array of classes and functions to
check.
@param {Array<module:jsdoc/doclet.Doclet>} modules The array of module doclets to search.