UNPKG

test-exclude

Version:

test for inclusion or exclusion of paths using globs

11 lines (7 loc) 271 B
'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); };