istanbul-lib-coverage
Advanced tools
Comparing version 3.2.1 to 3.2.2
@@ -49,2 +49,10 @@ # Change Log | ||
## [3.2.2](https://github.com/istanbuljs/istanbuljs/compare/istanbul-lib-coverage-v3.2.1...istanbul-lib-coverage-v3.2.2) (2023-11-07) | ||
### Bug Fixes | ||
* [#753](https://github.com/istanbuljs/istanbuljs/issues/753) ([c4895bb](https://github.com/istanbuljs/istanbuljs/commit/c4895bb418c55700182f481b914b74b2865a9bea)) | ||
* Proper data validation in findNearestContainer ([#754](https://github.com/istanbuljs/istanbuljs/issues/754)) ([c4895bb](https://github.com/istanbuljs/istanbuljs/commit/c4895bb418c55700182f481b914b74b2865a9bea)), closes [#753](https://github.com/istanbuljs/istanbuljs/issues/753) | ||
## [3.2.1](https://github.com/istanbuljs/istanbuljs/compare/istanbul-lib-coverage-v3.2.0...istanbul-lib-coverage-v3.2.1) (2023-11-04) | ||
@@ -51,0 +59,0 @@ |
@@ -48,2 +48,8 @@ /* | ||
const isObj = o => !!o && typeof o === 'object'; | ||
const isLineCol = o => | ||
isObj(o) && typeof o.line === 'number' && typeof o.column === 'number'; | ||
const isLoc = o => isObj(o) && isLineCol(o.start) && isLineCol(o.end); | ||
const getLoc = o => (isLoc(o) ? o : isLoc(o.loc) ? o.loc : null); | ||
// When merging, we can have a case where two ranges cover | ||
@@ -56,2 +62,4 @@ // the same block of code with `hits=1`, and each carve out a | ||
const findNearestContainer = (item, map) => { | ||
const itemLoc = getLoc(item); | ||
if (!itemLoc) return null; | ||
// the B item is not an identified range in the A set, BUT | ||
@@ -67,4 +75,4 @@ // it may be contained by an identified A range. If so, then | ||
for (const [i, mapItem] of Object.entries(map)) { | ||
const mapLoc = mapItem.loc; | ||
const itemLoc = item.loc; | ||
const mapLoc = getLoc(mapItem); | ||
if (!mapLoc) continue; | ||
// contained if all of line distances are > 0 | ||
@@ -71,0 +79,0 @@ // or line distance is 0 and col dist is >= 0 |
{ | ||
"name": "istanbul-lib-coverage", | ||
"version": "3.2.1", | ||
"version": "3.2.2", | ||
"description": "Data library for istanbul coverage objects", | ||
@@ -5,0 +5,0 @@ "author": "Krishnan Anantheswaran <kananthmail-github@yahoo.com>", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
34367
715