Socket
Socket
Sign inDemoInstall

fs-jetpack

Package Overview
Dependencies
Maintainers
1
Versions
61
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fs-jetpack - npm Package Compare versions

Comparing version 0.10.4 to 0.10.5

4

CHANGELOG.md

@@ -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 @@ -------------------

12

lib/find.js

@@ -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 () {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc