MCPcopy Create free account
hub / github.com/code-pushup/cli / expandCategories

Function expandCategories

packages/plugin-lighthouse/src/lib/categories.ts:61–72  ·  view source on GitHub ↗
(
  plugin: Pick<PluginConfig, 'context'>,
  categories: CategoryConfig[],
)

Source from the content-addressed store, hash-verified

59}
60
61function 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.

Callers 1

lighthouseCategoriesFunction · 0.70

Calls 3

validateFunction · 0.90
shouldExpandForUrlsFunction · 0.90
expandAggregatedCategoryFunction · 0.70

Tested by

no test coverage detected