( weights: PluginUrlContext['weights'], index: number, userDefinedWeight?: number, )
| 23 | } |
| 24 | |
| 25 | export 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 | |
| 37 | export function expandAuditsForUrls(audits: Audit[], urls: string[]): Audit[] { |
| 38 | return urls.flatMap((url, index) => |
no outgoing calls
no test coverage detected