istanbul-lib-coverage
Advanced tools
Comparing version 1.0.2 to 1.1.0
@@ -6,2 +6,18 @@ # Change Log | ||
<a name="1.1.0"></a> | ||
# [1.1.0](https://github.com/istanbuljs/istanbul-lib-coverage/compare/istanbul-lib-coverage@1.0.2...istanbul-lib-coverage@1.1.0) (2017-04-29) | ||
### Bug Fixes | ||
* getBranchCoverageByLine() was looking for line coverage using wrong object structure ([bf36658](https://github.com/istanbuljs/istanbul-lib-coverage/commit/bf36658)) | ||
### Features | ||
* add possibility to filter coverage maps when running reports post-hoc ([#24](https://github.com/istanbuljs/istanbuljs/issues/24)) ([e1c99d6](https://github.com/istanbuljs/istanbul-lib-coverage/commit/e1c99d6)) | ||
<a name="1.0.2"></a> | ||
@@ -8,0 +24,0 @@ ## [1.0.2](https://github.com/istanbuljs/istanbul-lib-coverage/compare/istanbul-lib-coverage@1.0.1...istanbul-lib-coverage@1.0.2) (2017-03-27) |
@@ -61,2 +61,16 @@ /* | ||
/** | ||
* filter the coveragemap based on the callback provided | ||
* @param {Function (filename)} callback - Returns true if the path | ||
* should be included in the coveragemap. False if it should be | ||
* removed. | ||
*/ | ||
CoverageMap.prototype.filter = function (callback) { | ||
var that = this; | ||
Object.keys(that.data).forEach(function (k) { | ||
if (!callback(k)) { | ||
delete that.data[k]; | ||
} | ||
}); | ||
}; | ||
/** | ||
* returns a JSON-serializable POJO for this coverage map | ||
@@ -63,0 +77,0 @@ * @returns {Object} |
@@ -207,3 +207,3 @@ /* | ||
Object.keys(branchMap).forEach(function (k) { | ||
var line = branchMap[k].line, | ||
var line = branchMap[k].line || branchMap[k].loc.start.line, | ||
branchData = branches[k]; | ||
@@ -210,0 +210,0 @@ ret[line] = ret[line] || []; |
{ | ||
"name": "istanbul-lib-coverage", | ||
"version": "1.0.2", | ||
"version": "1.1.0", | ||
"description": "Data library for istanbul coverage objects", | ||
"author": "Krishnan Anantheswaran <kananthmail-github@yahoo.com>", | ||
"main": "index.js", | ||
"files": [ | ||
"lib", | ||
"index.js" | ||
], | ||
"scripts": { | ||
@@ -8,0 +12,0 @@ "pretest": "jshint index.js lib/ test/", |
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
20666
508
7