Skip to content

Commit

Permalink
Make single require check more readable
Browse files Browse the repository at this point in the history
  • Loading branch information
mstade committed Dec 21, 2015
1 parent 4f81dbc commit d0ca885
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions bin/tape
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ var opts = parseOpts(process.argv.slice(2), {

var cwd = process.cwd();

/* If only one require is specified, the value of `opts.require`
* will be a string. This is why we concatenate.
*/
;[].concat(opts.require).forEach(function(module) {
if (typeof opts.require === 'string') {
opts.require = [opts.require];
}

opts.require.forEach(function(module) {
/* The `module &&` ensures we ignore `-r ""`, trailing `-r` or other
* silly things the user might (inadvertedly) be doing.
*/
Expand Down

0 comments on commit d0ca885

Please sign in to comment.