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

Function expandCategoryRefs

packages/utils/src/lib/plugin-url-aggregation.ts:63–74  ·  view source on GitHub ↗
(
  ref: CategoryRefInput,
  context: PluginUrlContext,
)

Source from the content-addressed store, hash-verified

61type CategoryRefInput = Omit<CategoryRef, 'weight'> & { weight?: number };
62
63export function expandCategoryRefs(
64 ref: CategoryRefInput,
65 context: PluginUrlContext,
66): CategoryRef[] {
67 return Array.from({ length: context.urlCount }, (_, i) => ({
68 ...ref,
69 slug: shouldExpandForUrls(context.urlCount)
70 ? addIndex(ref.slug, i)
71 : ref.slug,
72 weight: resolveUrlWeight(context.weights, i, ref.weight),
73 }));
74}

Callers 8

lighthouseGroupRefsFunction · 0.90
lighthouseAuditRefsFunction · 0.90
createAggregatedCategoryFunction · 0.90
expandAggregatedCategoryFunction · 0.90
axeGroupRefsFunction · 0.90
axeAuditRefsFunction · 0.90
expandAggregatedCategoryFunction · 0.90

Calls 3

shouldExpandForUrlsFunction · 0.85
addIndexFunction · 0.85
resolveUrlWeightFunction · 0.85

Tested by

no test coverage detected