export function renderGroupedByArea()

in src/common/output-utils/asciidoc.ts [38:70]


export function renderGroupedByArea(
  [areas, unknown]: GroupedByArea,
  type: PrType,
  config: Config,
  version: string
): string {
  const output: string[] = [];
  const sortedAreas = [...config.areas].sort((a, b) => a.title.localeCompare(b.title));
  for (const area of sortedAreas) {
    if (areas[area.title]) {
      output.push(
        Mustache.render(config.templates.prGroup, {
          groupTitle: area.title,
          // If the area has a textOverwriteTemplate render that instead of the list of PRs
          prs: area.options?.textOverwriteTemplate
            ? Mustache.render(area.options.textOverwriteTemplate, { version })
            : areas[area.title]
                .map((pr) => renderPrAsAsciidoc(pr, type, config, area.options))
                .join('\n'),
        })
      );
    }
  }
  if (unknown.length > 0) {
    output.push(
      Mustache.render(config.templates.prGroup, {
        groupTitle: 'Other',
        prs: unknown.map((pr) => renderPrAsAsciidoc(pr, type, config)).join('\n'),
      })
    );
  }
  return output.join('\n');
}