UNPKG
test-exclude
Version:
latest (8.0.0)
8.0.0
7.0.2
7.0.1
7.0.0
6.0.0
6.0.0-alpha.3
6.0.0-alpha.2
6.0.0-alpha.1
6.0.0-alpha.0
6.0.0-alhpa.3
5.2.3
5.2.2
5.2.1
5.2.0
5.1.0
5.0.1
5.0.0
4.2.3
4.2.2
4.2.1
4.2.0
4.1.1
4.1.0
4.0.3
4.0.2
4.0.1
4.0.0
3.3.0
3.2.2
3.2.1
3.2.0
3.1.0
3.0.0
2.1.3
2.1.2
2.1.1
2.1.0
2.0.0
1.1.0
1.0.0
test for inclusion or exclusion of paths using globs
istanbul.js.org
istanbuljs/test-exclude
test-exclude
/
is-outside-dir-win32.js
11 lines
(7 loc)
•
271 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
'use strict'
;
const
path =
require
(
'path'
);
const
{ minimatch } =
require
(
'minimatch'
);
const
dot = {
dot
:
true
,
windowsPathsNoEscape
:
true
};
module
.
exports
=
function
(
dir, filename
) {
return
!
minimatch
(path.
resolve
(dir, filename), path.
join
(dir,
'**'
), dot); };