Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function isIgnored(p) {
var fnmatch = glob.fnmatch(p, somePath, ~(glob.FNM_PATHNAME | glob.FNM_CASEFOLD)),
lsmatch = isDirectory(p) && p.match(/^[^\/]*\/?$/) &&
somePath.match(new RegExp("^" + p + ".*"));
return !!(fnmatch || lsmatch);
}