path-filters
Advanced tools
Comparing version 1.0.4 to 1.0.5
17
index.js
@@ -8,2 +8,6 @@ var fs = require('fs'); | ||
function normalizePath(path) { | ||
return path = path.replace(/\\/g, '/'); | ||
} | ||
var simpleRegExpTest = /[\?\*]/; | ||
@@ -101,3 +105,8 @@ | ||
PathFilters.prototype.isEmpty = function() { | ||
return this._filters.length === 0; | ||
} | ||
PathFilters.prototype.getMatch = function(path) { | ||
path = normalizePath(path); | ||
for (var i = 0, len = this._filters.length; i < len; i++) { | ||
@@ -113,2 +122,3 @@ var result = this._filters[i].test(path); | ||
PathFilters.prototype.getMatches = function(path) { | ||
path = normalizePath(path); | ||
var matches = []; | ||
@@ -126,2 +136,3 @@ for (var i = 0, len = this._filters.length; i < len; i++) { | ||
PathFilters.prototype.hasMatch = function(path) { | ||
path = normalizePath(path); | ||
return this.getMatch(path) !== undefined ? true : false; | ||
@@ -184,2 +195,6 @@ } | ||
PathFilters.prototype.toString = function() { | ||
return require('util').inspect(this._filters); | ||
} | ||
module.exports = { | ||
@@ -190,2 +205,2 @@ PathFilters: PathFilters, | ||
} | ||
} | ||
} |
{ | ||
"name": "path-filters", | ||
"description": "Manages a collection of path-based filters", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"homepage": "https://github.com/philidem/node-path-filters", | ||
@@ -6,0 +6,0 @@ "authors": [ |
Sorry, the diff of this file is not supported yet
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
188
6985
6
1