Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

istanbul-reports

Package Overview
Dependencies
Maintainers
4
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

istanbul-reports - npm Package Compare versions

Comparing version 3.0.1 to 3.0.2

11

CHANGELOG.md

@@ -6,2 +6,13 @@ # Change Log

## [3.0.2](https://github.com/istanbuljs/istanbuljs/compare/istanbul-reports@3.0.1...istanbul-reports@3.0.2) (2020-04-01)
### Bug Fixes
* Ignore insignificant lines when coalesce ([#525](https://github.com/istanbuljs/istanbuljs/issues/525)) ([d7d7cfa](https://github.com/istanbuljs/istanbuljs/commit/d7d7cfa1301f0dde2ff19078c31235ffd55c01ef))
## [3.0.1](https://github.com/istanbuljs/istanbuljs/compare/istanbul-reports@3.0.0...istanbul-reports@3.0.1) (2020-03-26)

@@ -8,0 +19,0 @@

32

lib/text/index.js

@@ -70,3 +70,3 @@ /*

let missingLines;
let coveredLines;

@@ -76,15 +76,21 @@ const fileCoverage = node.getFileCoverage();

const branches = fileCoverage.getBranchCoverageByLine();
missingLines = Object.keys(branches).filter(
key => branches[key].coverage < 100
);
coveredLines = Object.entries(branches).map(([key, { coverage }]) => [
key,
coverage === 100
]);
} else {
missingLines = fileCoverage.getUncoveredLines();
coveredLines = Object.entries(fileCoverage.getLineCoverage());
}
const ranges = missingLines
.reduce((acum, line) => {
line = parseInt(line);
const range = acum[acum.length - 1];
if (range && range[range.length - 1] === line - 1) range.push(line);
else acum.push([line]);
let newRange = true;
const ranges = coveredLines
.reduce((acum, [line, hit]) => {
if (hit) newRange = true;
else {
line = parseInt(line);
if (newRange) {
acum.push([line]);
newRange = false;
} else acum[acum.length - 1][1] = line;
}

@@ -96,5 +102,5 @@ return acum;

if (length <= 2) return range;
if (length === 1) return range[0];
return `${range[0]}-${range[length - 1]}`;
return `${range[0]}-${range[1]}`;
});

@@ -101,0 +107,0 @@

{
"name": "istanbul-reports",
"version": "3.0.1",
"version": "3.0.2",
"description": "istanbul reports",

@@ -60,3 +60,3 @@ "author": "Krishnan Anantheswaran <kananthmail-github@yahoo.com>",

},
"gitHead": "df24342395030dc2a40a7ceb0476a9897f3492a3"
"gitHead": "73c25ce79f91010d1ff073aa6ff3fd01114f90db"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc