Socket
Socket
Sign inDemoInstall

c8

Package Overview
Dependencies
Maintainers
2
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 7.6.0 to 7.7.0

7

CHANGELOG.md

@@ -5,2 +5,9 @@ # Changelog

## [7.7.0](https://www.github.com/bcoe/c8/compare/v7.6.0...v7.7.0) (2021-03-30)
### Features
* introduce --exclude-after-remap flag ([#293](https://www.github.com/bcoe/c8/issues/293)) ([53c4234](https://www.github.com/bcoe/c8/commit/53c42347e0ed4eb29e37b84d40768eed89bf9eb0)), closes [#224](https://www.github.com/bcoe/c8/issues/224)
## [7.6.0](https://www.github.com/bcoe/c8/compare/v7.5.0...v7.6.0) (2021-02-17)

@@ -7,0 +14,0 @@

1

lib/commands/report.js

@@ -16,2 +16,3 @@ const { checkCoverages } = require('./check-coverage')

exclude: argv.exclude,
excludeAfterRemap: argv.excludeAfterRemap,
reporter: Array.isArray(argv.reporter) ? argv.reporter : [argv.reporter],

@@ -18,0 +19,0 @@ reportsDirectory: argv['reports-dir'],

@@ -29,2 +29,8 @@ const defaultExclude = require('@istanbuljs/schema/default-exclude')

})
.option('exclude-after-remap', {
alias: 'a',
type: 'boolean',
default: false,
describe: 'apply exclude logic to files after they are remapped by a source-map'
})
.option('include', {

@@ -31,0 +37,0 @@ alias: 'n',

15

lib/report.js

@@ -18,2 +18,3 @@ const Exclude = require('test-exclude')

exclude,
excludeAfterRemap,
include,

@@ -42,2 +43,3 @@ reporter,

})
this.excludeAfterRemap = excludeAfterRemap
this.omitRelative = omitRelative

@@ -93,3 +95,7 @@ this.sourceMapCache = {}

const path = resolve(this.resolve, v8ScriptCov.url)
const converter = v8toIstanbul(path, this.wrapperLength, sources)
const converter = v8toIstanbul(path, this.wrapperLength, sources, (path) => {
if (this.excludeAfterRemap) {
return !this.exclude.shouldInstrument(path)
}
})
await converter.load()

@@ -282,5 +288,6 @@

}
if (this.exclude.shouldInstrument(v8ScriptCov.url) &&
(!this.omitRelative || isAbsolute(v8ScriptCov.url))) {
result.push(v8ScriptCov)
if ((!this.omitRelative || isAbsolute(v8ScriptCov.url))) {
if (this.excludeAfterRemap || this.exclude.shouldInstrument(v8ScriptCov.url)) {
result.push(v8ScriptCov)
}
}

@@ -287,0 +294,0 @@ }

{
"name": "c8",
"version": "7.6.0",
"version": "7.7.0",
"description": "output coverage reports using Node.js' built in coverage",

@@ -47,4 +47,4 @@ "main": "./index.js",

"v8-to-istanbul": "^7.1.0",
"yargs": "^16.0.0",
"yargs-parser": "^20.0.0"
"yargs": "^16.2.0",
"yargs-parser": "^20.2.7"
},

@@ -51,0 +51,0 @@ "devDependencies": {

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