( plugin: Pick<PluginConfig, 'groups' | 'context'>, categories?: CategoryConfig[], )
| 31 | * ]; |
| 32 | */ |
| 33 | export function lighthouseCategories( |
| 34 | plugin: Pick<PluginConfig, 'groups' | 'context'>, |
| 35 | categories?: CategoryConfig[], |
| 36 | ): CategoryConfig[] { |
| 37 | if (!plugin.groups || plugin.groups.length === 0) { |
| 38 | return categories ?? []; |
| 39 | } |
| 40 | if (!categories) { |
| 41 | return createCategories(plugin); |
| 42 | } |
| 43 | return expandCategories(plugin, categories); |
| 44 | } |
| 45 | |
| 46 | /** |
| 47 | * @deprecated |
no test coverage detected