From 7a3df06eb573d36142bd1a8e03c5ce8752d300b3 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Wed, 24 May 2017 15:10:37 +0200 Subject: fix build issues and add typedoc --- node_modules/istanbul-lib-coverage/lib/coverage-map.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'node_modules/istanbul-lib-coverage/lib/coverage-map.js') diff --git a/node_modules/istanbul-lib-coverage/lib/coverage-map.js b/node_modules/istanbul-lib-coverage/lib/coverage-map.js index 440779a6a..ccb3c8a4c 100644 --- a/node_modules/istanbul-lib-coverage/lib/coverage-map.js +++ b/node_modules/istanbul-lib-coverage/lib/coverage-map.js @@ -57,6 +57,20 @@ CoverageMap.prototype.merge = function (obj) { } }); }; +/** + * 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 * @returns {Object} -- cgit v1.2.3