diff --git a/index.js b/index.js index 637cc5e..7a8aa96 100644 --- a/index.js +++ b/index.js @@ -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; }