( plugin: Pick<PluginConfig, 'context'>, categories: CategoryConfig[], )
| 59 | } |
| 60 | |
| 61 | function expandCategories( |
| 62 | plugin: Pick<PluginConfig, 'context'>, |
| 63 | categories: CategoryConfig[], |
| 64 | ): CategoryConfig[] { |
| 65 | const context = validate(pluginUrlContextSchema, plugin.context); |
| 66 | if (!shouldExpandForUrls(context.urlCount)) { |
| 67 | return categories; |
| 68 | } |
| 69 | return categories.map(category => |
| 70 | expandAggregatedCategory(category, context), |
| 71 | ); |
| 72 | } |
| 73 | |
| 74 | /** |
| 75 | * Creates a category config for a Lighthouse group, expanding it for each URL. |
no test coverage detected