Skip to content

Commit

Permalink
Update: Fix linting error by using ternaries
Browse files Browse the repository at this point in the history
  • Loading branch information
Contra authored and phated committed Feb 21, 2017
1 parent 4b7a54b commit b6aae57
Showing 1 changed file with 6 additions and 15 deletions.
21 changes: 6 additions & 15 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,12 @@ function globStream(globs, opt) {
var ourOpt = extend({}, opt);
var ignore = ourOpt.ignore;

if (typeof ourOpt.cwd !== 'string') {
ourOpt.cwd = process.cwd();
}
if (typeof ourOpt.dot !== 'boolean') {
ourOpt.dot = false;
}
if (typeof ourOpt.silent !== 'boolean') {
ourOpt.silent = true;
}
if (typeof ourOpt.nonull !== 'boolean') {
ourOpt.nonull = false;
}
if (typeof ourOpt.cwdbase !== 'boolean') {
ourOpt.cwdbase = false;
}
ourOpt.cwd = typeof ourOpt.cwd === 'string' ? ourOpt.cwd : process.cwd();
ourOpt.dot = typeof ourOpt.dot === 'boolean' ? ourOpt.dot : false;
ourOpt.silent = typeof ourOpt.silent === 'boolean' ? ourOpt.silent : true;
ourOpt.nonull = typeof ourOpt.nonull === 'boolean' ? ourOpt.nonull : false;
ourOpt.cwdbase = typeof ourOpt.cwdbase === 'boolean' ? ourOpt.cwdbase : false;

if (ourOpt.cwdbase) {
ourOpt.base = ourOpt.cwd;
}
Expand Down

0 comments on commit b6aae57

Please sign in to comment.