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

test-exclude

Package Overview
Dependencies
Maintainers
2
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

test-exclude - npm Package Compare versions

Comparing version 4.0.3 to 4.1.0

11

CHANGELOG.md

@@ -6,2 +6,13 @@ # Change Log

<a name="4.1.0"></a>
# [4.1.0](https://github.com/istanbuljs/test-exclude/compare/test-exclude@4.0.3...test-exclude@4.1.0) (2017-04-29)
### 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/test-exclude/commit/e1c99d6))
<a name="4.0.3"></a>

@@ -8,0 +19,0 @@ ## [4.0.3](https://github.com/istanbuljs/test-exclude/compare/test-exclude@4.0.2...test-exclude@4.0.3) (2017-03-21)

16

index.js

@@ -12,2 +12,3 @@ const assign = require('object-assign')

include: false,
relativePath: true,
configKey: null, // the key to load config from in package.json.

@@ -59,9 +60,14 @@ configPath: null, // optionally override requireMainFilename.

TestExclude.prototype.shouldInstrument = function (filename, relFile) {
relFile = relFile || path.relative(this.cwd, filename)
var pathToCheck = filename
// Don't instrument files that are outside of the current working directory.
if (/^\.\./.test(path.relative(this.cwd, filename))) return false
if (this.relativePath) {
relFile = relFile || path.relative(this.cwd, filename)
relFile = relFile.replace(/^\.[\\/]/, '') // remove leading './' or '.\'.
return (!this.include || micromatch.any(relFile, this.include, {dotfiles: true})) && !micromatch.any(relFile, this.exclude, {dotfiles: true})
// Don't instrument files that are outside of the current working directory.
if (/^\.\./.test(path.relative(this.cwd, filename))) return false
pathToCheck = relFile.replace(/^\.[\\/]/, '') // remove leading './' or '.\'.
}
return (!this.include || micromatch.any(pathToCheck, this.include, {dotfiles: true})) && !micromatch.any(pathToCheck, this.exclude, {dotfiles: true})
}

@@ -68,0 +74,0 @@

{
"name": "test-exclude",
"version": "4.0.3",
"version": "4.1.0",
"description": "test for inclusion or exclusion of paths using pkg-conf and globs",
"main": "index.js",
"files": [
"index.js"
],
"scripts": {

@@ -7,0 +10,0 @@ "pretest": "standard",

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