* Find the function with highest `endOffset` to determine the length of the file
(functions: Profiler.FunctionCoverage[])
| 464 | * Find the function with highest `endOffset` to determine the length of the file |
| 465 | */ |
| 466 | function findLongestFunctionLength(functions: Profiler.FunctionCoverage[]) { |
| 467 | return functions.reduce((previous, current) => { |
| 468 | const maxEndOffset = current.ranges.reduce( |
| 469 | (endOffset, range) => Math.max(endOffset, range.endOffset), |
| 470 | 0, |
| 471 | ) |
| 472 | |
| 473 | return Math.max(previous, maxEndOffset) |
| 474 | }, 0) |
| 475 | } |
| 476 | |
| 477 | function removeStartsWith(filepath: string, start: string) { |
| 478 | if (filepath.startsWith(start)) { |