Comparing version 1.7.2 to 1.7.3
@@ -195,3 +195,3 @@ // Generated by CoffeeScript 1.6.3 | ||
Finder.prototype.getPathsFromParents = function(mask, type) { | ||
var depth, directory, i, paths, result, _i, _ref; | ||
var depth, directory, i, match, paths, result, _i, _ref; | ||
if (mask == null) { | ||
@@ -211,3 +211,4 @@ mask = null; | ||
} else if (typeof this.up === 'string') { | ||
depth = _path.relative(this.up, directory).match(/\//g).length + 2; | ||
match = _path.relative(this.up, directory).match(/\//g); | ||
depth = match === null ? 2 : match.length + 2; | ||
} else { | ||
@@ -214,0 +215,0 @@ depth = this.up - 1; |
{ | ||
"name": "fs-finder", | ||
"description": "File system recursive finder", | ||
"version": "1.7.2", | ||
"version": "1.7.3", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "name": "David Kudera", |
@@ -144,2 +144,5 @@ # fs-finder | ||
* 1.7.3 | ||
+ Bug in `lookUp` method | ||
* 1.7.2 | ||
@@ -146,0 +149,0 @@ + Added option to set depth in `lookUp` with path |
@@ -63,3 +63,3 @@ // Generated by CoffeeScript 1.6.3 | ||
return it('should return file names recursively from find* methods', function() { | ||
return Finder.from(dir).findFiles().should.eql(["" + dir + "/0", "" + dir + "/1", "" + dir + "/eight/3/4/file.json", "" + dir + "/five", "" + dir + "/one", "" + dir + "/seven/13", "" + dir + "/seven/14", "" + dir + "/seven/twelve", "" + dir + "/six/eleven", "" + dir + "/six/nine", "" + dir + "/six/ten", "" + dir + "/three", "" + dir + "/two"]); | ||
return Finder.from(dir).findFiles().should.eql(["" + dir + "/0", "" + dir + "/1", "" + dir + "/eight/3/4/file.json", "" + dir + "/eight/other.js", "" + dir + "/eight/package.json", "" + dir + "/five", "" + dir + "/one", "" + dir + "/seven/13", "" + dir + "/seven/14", "" + dir + "/seven/twelve", "" + dir + "/six/eleven", "" + dir + "/six/nine", "" + dir + "/six/ten", "" + dir + "/three", "" + dir + "/two"]); | ||
}); | ||
@@ -81,2 +81,5 @@ }); | ||
}); | ||
it('should return first file in parent directorz with depth set by string', function() { | ||
return Finder["in"]("" + dir + "/eight").lookUp(dir).findFiles('package.json').should.be.eql(["" + dir + "/eight/package.json"]); | ||
}); | ||
it('should return path to file in parent directory recursively', function() { | ||
@@ -83,0 +86,0 @@ return Finder.from("" + dir + "/eight/3/4").lookUp(4).findFiles('twelve').should.be.eql(["" + dir + "/seven/twelve"]); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
38201
27
457
199