(pathSlices: PathSlice[])
| 190 | maxWeight: number |
| 191 | ): Array<PathSlice> { |
| 192 | const calculateWeight = (pathSlices: PathSlice[]): number => { |
| 193 | let weight = 0; |
| 194 | |
| 195 | for (const slice of pathSlices) { |
| 196 | weight += calculateSliceWeight(slice); |
| 197 | } |
| 198 | |
| 199 | return weight; |
| 200 | }; |
| 201 | |
| 202 | const calculateSliceWeight = (slice: PathSlice): number => { |
| 203 | if (slice.type === "component") { |
no test coverage detected