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

Function resolveUrlWeight

packages/utils/src/lib/plugin-url-aggregation.ts:25–35  ·  view source on GitHub ↗
(
  weights: PluginUrlContext['weights'],
  index: number,
  userDefinedWeight?: number,
)

Source from the content-addressed store, hash-verified

23}
24
25export function resolveUrlWeight(
26 weights: PluginUrlContext['weights'],
27 index: number,
28 userDefinedWeight?: number,
29): number {
30 const urlWeight = weights[index + 1] ?? 1;
31 if (userDefinedWeight == null) {
32 return urlWeight;
33 }
34 return (urlWeight + userDefinedWeight) / 2;
35}
36
37export function expandAuditsForUrls(audits: Audit[], urls: string[]): Audit[] {
38 return urls.flatMap((url, index) =>

Callers 2

expandCategoryRefsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected