Skip to content

Commit

Permalink
Merge pull request #54 from ckross01/lint-fixes
Browse files Browse the repository at this point in the history
Linting fixes
  • Loading branch information
contra committed Nov 5, 2015
2 parents 2c3bff5 + e86c136 commit e3d5548
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
9 changes: 6 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,16 @@ var gs = {
var basePath = opt.base || glob2base(globber);

// Create stream and map events from globber to it
var stream = through2.obj(opt, negatives.length ? filterNegatives : undefined);
var stream = through2.obj(opt,
negatives.length ? filterNegatives : undefined);

var found = false;

globber.on('error', stream.emit.bind(stream, 'error'));
globber.once('end', function() {
if (opt.allowEmpty !== true && !found && globIsSingular(globber)) {
stream.emit('error', new Error('File not found with singular glob: ' + ourGlob));
stream.emit('error',
new Error('File not found with singular glob: ' + ourGlob));
}

stream.end();
Expand Down Expand Up @@ -138,7 +140,8 @@ var gs = {
return returnStream;

function streamFromPositive(positive) {
var negativeGlobs = negatives.filter(indexGreaterThan(positive.index)).map(toGlob);
var negativeGlobs = negatives.filter(indexGreaterThan(positive.index))
.map(toGlob);
return gs.createStream(positive.glob, negativeGlobs, opt);
}
},
Expand Down
9 changes: 3 additions & 6 deletions test/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ describe('glob-stream', function() {
stream.on('error', function(err) {
throw err;
});
wrapper.on('data', function(file) {
wrapper.on('data', function() {
count++;
});
wrapper.on('end', function() {
Expand All @@ -79,7 +79,6 @@ describe('glob-stream', function() {
];
var stream = gs.create(globArray, { cwd: baseDir, base: baseDir });

var files = [];
stream.on('error', done);
stream.on('data', function(file) {
should.exist(file);
Expand All @@ -101,7 +100,6 @@ describe('glob-stream', function() {
];
var stream = gs.create(globArray, { cwd: baseDir, cwdbase: true });

var files = [];
stream.on('error', done);
stream.on('data', function(file) {
should.exist(file);
Expand Down Expand Up @@ -177,7 +175,7 @@ describe('glob-stream', function() {
stream.on('error', function(err) {
throw err;
});
stream.once('data', function(file) {
stream.once('data', function() {
throw new Error('It matched!');
});
stream.once('end', done);
Expand Down Expand Up @@ -207,7 +205,7 @@ describe('glob-stream', function() {
stream.on('error', function(err) {
throw err;
});
stream.once('data', function(file) {
stream.once('data', function() {
throw new Error('It matched!');
});
stream.once('end', done);
Expand Down Expand Up @@ -311,7 +309,6 @@ describe('glob-stream', function() {
];
var stream = gs.create(globArray, { cwd: baseDir, cwdbase: true });

var files = [];
stream.on('error', done);
stream.on('data', function(file) {
should.exist(file);
Expand Down

0 comments on commit e3d5548

Please sign in to comment.