Socket
Socket
Sign inDemoInstall

c8

Package Overview
Dependencies
Maintainers
1
Versions
88
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

c8 - npm Package Compare versions

Comparing version 3.3.0-candidate.0 to 3.3.0-candidate.1

23

lib/report.js
const Exclude = require('test-exclude')
const furi = require('furi')
const libCoverage = require('istanbul-lib-coverage')

@@ -7,3 +8,4 @@ const libReport = require('istanbul-lib-report')

const { resolve, isAbsolute } = require('path')
const { mergeProcessCovs } = require('@c88/v8-coverage')
// TODO: switch back to @c88/v8-coverage once patch is landed.
const { mergeProcessCovs } = require('@bcoe/v8-coverage')
const v8toIstanbul = require('v8-to-istanbul')

@@ -78,3 +80,3 @@

for (const v8ProcessCov of this._loadReports()) {
v8ProcessCovs.push(this._filterProcessCov(v8ProcessCov))
v8ProcessCovs.push(this._normalizeProcessCov(v8ProcessCov))
}

@@ -106,4 +108,8 @@ return mergeProcessCovs(v8ProcessCovs)

/**
* Returns a filtered process coverage.
* Normalizes a process coverage.
*
* This function replaces file URLs (`url` property) by their corresponding
* system-dependent path and applies the current inclusion rules to filter out
* the excluded script coverages.
*
* The result is a copy of the input, with script coverages filtered based

@@ -113,11 +119,12 @@ * on their `url` and the current inclusion rules.

*
* @param v8ProcessCov V8 process coverage to filter.
* @return {v8ProcessCov} Filtered V8 process coverage.
* @param v8ProcessCov V8 process coverage to normalize.
* @return {v8ProcessCov} Normalized V8 process coverage.
* @private
*/
_filterProcessCov (v8ProcessCov) {
_normalizeProcessCov (v8ProcessCov) {
const result = []
for (const v8ScriptCov of v8ProcessCov.result) {
// TODO: implement real fix from https://github.com/nodejs/node/issues/23783
v8ScriptCov.url = v8ScriptCov.url.replace(/^file:\/\//, '')
if (/^file:\/\//.test(v8ScriptCov.url)) {
v8ScriptCov.url = furi.toSysPath(v8ScriptCov.url)
}
if (this.exclude.shouldInstrument(v8ScriptCov.url) &&

@@ -124,0 +131,0 @@ (!this.omitRelative || isAbsolute(v8ScriptCov.url))) {

{
"name": "c8",
"version": "3.3.0-candidate.0",
"version": "3.3.0-candidate.1",
"description": "output coverage reports using Node.js' built in coverage",

@@ -35,5 +35,6 @@ "main": "index.js",

"dependencies": {
"@c88/v8-coverage": "^0.1.0",
"@bcoe/v8-coverage": "^0.1.0",
"find-up": "^3.0.0",
"foreground-child": "^1.5.6",
"furi": "^1.0.0",
"istanbul-lib-coverage": "^2.0.1",

@@ -40,0 +41,0 @@ "istanbul-lib-report": "^2.0.1",

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