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

istanbul-lib-coverage

Package Overview
Dependencies
Maintainers
4
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

istanbul-lib-coverage - npm Package Compare versions

Comparing version 3.2.1 to 3.2.2

8

CHANGELOG.md

@@ -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 @@

12

lib/file-coverage.js

@@ -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

2

package.json
{
"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>",

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