MCPcopy Index your code
hub / github.com/code-pushup/cli / lighthouseAuditRefs

Function lighthouseAuditRefs

packages/plugin-lighthouse/src/lib/utils.ts:86–109  ·  view source on GitHub ↗
(
  plugin: Pick<PluginConfig, 'audits' | 'context'>,
  auditSlug?: string,
  auditWeight?: number,
)

Source from the content-addressed store, hash-verified

84 * @returns Array of category refs, expanded for each URL in multi-URL configs
85 */
86export function lighthouseAuditRefs(
87 plugin: Pick<PluginConfig, 'audits' | 'context'>,
88 auditSlug?: string,
89 auditWeight?: number,
90): CategoryRef[] {
91 const context = validate(pluginUrlContextSchema, plugin.context);
92 if (auditSlug) {
93 return expandCategoryRefs(
94 {
95 plugin: LIGHTHOUSE_PLUGIN_SLUG,
96 slug: auditSlug,
97 type: 'audit',
98 weight: auditWeight,
99 },
100 context,
101 );
102 }
103 return plugin.audits.flatMap(({ slug }) =>
104 expandCategoryRefs(
105 { plugin: LIGHTHOUSE_PLUGIN_SLUG, slug, type: 'audit' },
106 context,
107 ),
108 );
109}
110
111export function lighthouseGroupSlugs(
112 plugin: Pick<PluginConfig, 'groups'>,

Callers 1

utils.unit.test.tsFile · 0.85

Calls 2

validateFunction · 0.90
expandCategoryRefsFunction · 0.90

Tested by

no test coverage detected