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