get categories()

in src/api/audits/models.ts [115:132]


  get categories(): Record<string, LighthouseCategoryAbbr> | undefined {
    if (!this.report) return undefined;

    return Object.keys(this.report.categories).reduce(
      (
        res: Record<string, LighthouseCategoryAbbr>,
        key: string,
      ): Record<string, LighthouseCategoryAbbr> => ({
        ...res,
        [key]: {
          id: (this.report as LHR).categories[key].id,
          title: (this.report as LHR).categories[key].title,
          score: (this.report as LHR).categories[key].score,
        },
      }),
      {},
    );
  }