Comparing version 1.6.1 to 1.6.2
@@ -30,5 +30,11 @@ var fs = require("fs"); | ||
var _walkSync = function(dir, done) { | ||
var results = []; | ||
var list = fs.readdirSync(dir); | ||
var _walkSync = function(dir, results, filters) { | ||
for(var j=0; j<filters.length; j++) { | ||
if(dir.indexOf(filters[j]) != -1) { | ||
return | ||
} | ||
} | ||
var list = fs.readdirSync(dir); | ||
for(var i=0; i<list.length; i++) { | ||
@@ -39,7 +45,7 @@ var file = list[i]; | ||
} else { | ||
file = dir + '/' + file; | ||
file = path.join(dir, file); | ||
var stat = fs.statSync(file); | ||
if (stat && stat.isDirectory()) { | ||
var res = _walkSync(file); | ||
results = results.concat(res); | ||
var res = _walkSync(file, results, filters); | ||
} else { | ||
@@ -65,6 +71,8 @@ results.push(file); | ||
var walk = function(dir) { | ||
return _walkSync(dir); | ||
var walk = function(dir, filters) { | ||
var result = []; | ||
_walkSync(dir, result, filters); | ||
return result; | ||
} | ||
module.exports=walk; |
{ | ||
"name": "gutil", | ||
"description": "GUtil", | ||
"version": "1.6.1", | ||
"version": "1.6.2", | ||
"private": false, | ||
@@ -6,0 +6,0 @@ "licenses": [ |
@@ -75,2 +75,2 @@ gutil | ||
- **walk** | ||
- **string** : utils functions for String | ||
- **string** : utils functions for String |
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
Copyleft License
License(Experimental) Copyleft license information was found.
Found 1 instance in 1 package
Non-permissive License
License(Experimental) A license not known to be considered permissive was found.
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
80582
48
1592
76
2
70