MCPcopy Index your code
hub / github.com/nodejs/node / formatLinesToRanges

Function formatLinesToRanges

lib/internal/test_runner/utils.js:508–517  ·  view source on GitHub ↗
(values)

Source from the content-addressed store, hash-verified

506}
507
508function formatLinesToRanges(values) {
509 return ArrayPrototypeMap(ArrayPrototypeReduce(values, (prev, current, index, array) => {
510 if ((index > 0) && ((current - array[index - 1]) === 1)) {
511 prev[prev.length - 1][1] = current;
512 } else {
513 prev.push([current]);
514 }
515 return prev;
516 }, []), (range) => ArrayPrototypeJoin(range, '-'));
517}
518
519function getUncoveredLines(lines) {
520 return ArrayPrototypeFlatMap(lines, (line) => (line.count === 0 ? line.line : []));

Callers 1

formatUncoveredLinesFunction · 0.85

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…