fs-jetpack
Advanced tools
Comparing version 0.10.4 to 0.10.5
@@ -0,1 +1,5 @@ | ||
0.10.5 (2016-12-07) | ||
------------------- | ||
* Fixed `find()` bug when directories is set to true and only negation glob is used. | ||
0.10.4 (2016-12-06) | ||
@@ -2,0 +6,0 @@ ------------------- |
@@ -56,3 +56,3 @@ 'use strict'; | ||
}, function (itemPath, item) { | ||
if (matchesAnyOfGlobs(itemPath)) { | ||
if (itemPath !== path && matchesAnyOfGlobs(itemPath)) { | ||
if ((item.type === 'file' && options.files === true) | ||
@@ -97,9 +97,7 @@ || (item.type === 'dir' && options.directories === true)) { | ||
var item; | ||
if (data) { | ||
if (data && data.path !== path && matchesAnyOfGlobs(data.path)) { | ||
item = data.item; | ||
if (matchesAnyOfGlobs(data.path)) { | ||
if ((item.type === 'file' && options.files === true) | ||
|| (item.type === 'dir' && options.directories === true)) { | ||
foundInspectObjects.push(item); | ||
} | ||
if ((item.type === 'file' && options.files === true) | ||
|| (item.type === 'dir' && options.directories === true)) { | ||
foundInspectObjects.push(item); | ||
} | ||
@@ -106,0 +104,0 @@ } |
{ | ||
"name": "fs-jetpack", | ||
"description": "Better file system API", | ||
"version": "0.10.4", | ||
"version": "0.10.5", | ||
"author": "Jakub Szwacz <jakub@szwacz.com>", | ||
@@ -6,0 +6,0 @@ "dependencies": { |
@@ -334,2 +334,35 @@ var fse = require('fs-extra'); | ||
describe('looking for directories works ok with only negation globs in set', function () { | ||
var preparations = function () { | ||
fse.outputFileSync('a/x', '123'); | ||
fse.outputFileSync('a/y', '789'); | ||
}; | ||
var expectations = function (found) { | ||
var normalizedPaths = helper.osSep(['a/x']); | ||
expect(found).to.eql(normalizedPaths); | ||
}; | ||
it('sync', function () { | ||
preparations(); | ||
expectations(jetpack.find('a', { | ||
matching: ['!y'], | ||
directories: true | ||
})); | ||
}); | ||
it('async', function (done) { | ||
preparations(); | ||
jetpack.findAsync('a', { | ||
matching: ['!y'], | ||
directories: true | ||
}) | ||
.then(function (found) { | ||
expectations(found); | ||
done(); | ||
}) | ||
.catch(done); | ||
}); | ||
}); | ||
describe('when you turn off files and directoies returns empty list', function () { | ||
@@ -336,0 +369,0 @@ var preparations = function () { |
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
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
210410
5988