test-exclude
Advanced tools
Comparing version 6.0.0-alpha.0 to 6.0.0-alpha.1
@@ -1,6 +0,12 @@ | ||
# Change Log | ||
# Changelog | ||
All notable changes to this project will be documented in this file. | ||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. | ||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. | ||
## [6.0.0-alpha.1](https://github.com/istanbuljs/test-exclude/compare/v6.0.0-alpha.0...v6.0.0-alpha.1) (2019-09-24) | ||
### Features | ||
* Add async glob function ([#30](https://github.com/istanbuljs/test-exclude/issues/30)) ([e45ac10](https://github.com/istanbuljs/test-exclude/commit/e45ac10)) | ||
# [6.0.0-alpha.0](https://github.com/istanbuljs/istanbuljs/compare/test-exclude@5.2.3...test-exclude@6.0.0-alpha.0) (2019-06-19) | ||
@@ -7,0 +13,0 @@ |
16
index.js
'use strict'; | ||
const path = require('path'); | ||
const glob = require('glob'); | ||
const { promisify } = require('util'); | ||
const glob = promisify(require('glob')); | ||
const minimatch = require('minimatch'); | ||
@@ -125,2 +126,15 @@ const defaultExclude = require('./default-exclude'); | ||
} | ||
async glob(cwd = this.cwd) { | ||
const globPatterns = getExtensionPattern(this.extension || []); | ||
const globOptions = { cwd, nodir: true, dot: true }; | ||
/* If we don't have any excludeNegated then we can optimize glob by telling | ||
* it to not iterate into unwanted directory trees (like node_modules). */ | ||
if (this.excludeNegated.length === 0) { | ||
globOptions.ignore = this.exclude; | ||
} | ||
const list = await glob(globPatterns, globOptions); | ||
return list.filter(file => this.shouldInstrument(path.resolve(cwd, file))); | ||
} | ||
} | ||
@@ -127,0 +141,0 @@ |
{ | ||
"name": "test-exclude", | ||
"version": "6.0.0-alpha.0", | ||
"version": "6.0.0-alpha.1", | ||
"description": "test for inclusion or exclusion of paths using globs", | ||
@@ -11,7 +11,8 @@ "main": "index.js", | ||
"scripts": { | ||
"test": "nyc mocha" | ||
"release": "standard-version", | ||
"test": "tap" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/istanbuljs/istanbuljs.git" | ||
"url": "git+https://github.com/istanbuljs/test-exclude.git" | ||
}, | ||
@@ -28,3 +29,3 @@ "keywords": [ | ||
"bugs": { | ||
"url": "https://github.com/istanbuljs/istanbuljs/issues" | ||
"url": "https://github.com/istanbuljs/test-exclude/issues" | ||
}, | ||
@@ -37,10 +38,8 @@ "homepage": "https://istanbul.js.org/", | ||
"devDependencies": { | ||
"chai": "^4.2.0", | ||
"mocha": "^6.1.4", | ||
"nyc": "^14.1.1" | ||
"standard-version": "^7.0.0", | ||
"tap": "^14.4.2" | ||
}, | ||
"engines": { | ||
"node": ">=8" | ||
}, | ||
"gitHead": "2e885073a9398806c9b8763dd39418398182ca34" | ||
} | ||
} |
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
19692
2
171