( plugin: Pick<PluginConfig, 'audits' | 'context'>, auditSlug?: string, auditWeight?: number, )
| 84 | * @returns Array of category refs, expanded for each URL in multi-URL configs |
| 85 | */ |
| 86 | export 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 | |
| 111 | export function lighthouseGroupSlugs( |
| 112 | plugin: Pick<PluginConfig, 'groups'>, |
no test coverage detected