( plugin: Pick<PluginConfig, 'groups' | 'context'>, groupSlug?: AxeGroupSlug, groupWeight?: number, )
| 44 | * @returns Array of category refs, expanded for each URL in multi-URL configs |
| 45 | */ |
| 46 | export function axeGroupRefs( |
| 47 | plugin: Pick<PluginConfig, 'groups' | 'context'>, |
| 48 | groupSlug?: AxeGroupSlug, |
| 49 | groupWeight?: number, |
| 50 | ): CategoryRef[] { |
| 51 | const context = validate(pluginUrlContextSchema, plugin.context); |
| 52 | if (groupSlug) { |
| 53 | return expandCategoryRefs( |
| 54 | { |
| 55 | slug: groupSlug, |
| 56 | weight: groupWeight, |
| 57 | type: 'group', |
| 58 | plugin: AXE_PLUGIN_SLUG, |
| 59 | }, |
| 60 | context, |
| 61 | ); |
| 62 | } |
| 63 | return axeGroupSlugs(plugin).flatMap(slug => |
| 64 | expandCategoryRefs( |
| 65 | { slug, type: 'group', plugin: AXE_PLUGIN_SLUG }, |
| 66 | context, |
| 67 | ), |
| 68 | ); |
| 69 | } |
| 70 | |
| 71 | /** |
| 72 | * Creates category refs for Axe audits with multi-URL support. |
no test coverage detected