Skip to content

Commit d0ca885

Browse files
committedDec 21, 2015
Make single require check more readable
1 parent 4f81dbc commit d0ca885

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed
 

‎bin/tape

+5-4
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@ var opts = parseOpts(process.argv.slice(2), {
1313

1414
var cwd = process.cwd();
1515

16-
/* If only one require is specified, the value of `opts.require`
17-
* will be a string. This is why we concatenate.
18-
*/
19-
;[].concat(opts.require).forEach(function(module) {
16+
if (typeof opts.require === 'string') {
17+
opts.require = [opts.require];
18+
}
19+
20+
opts.require.forEach(function(module) {
2021
/* The `module &&` ensures we ignore `-r ""`, trailing `-r` or other
2122
* silly things the user might (inadvertedly) be doing.
2223
*/

0 commit comments

Comments
 (0)
Please sign in to comment.