Skip to content

Commit ac62359

Browse files
committed
fix(args): fix args workaround for legacy api - don't overwrite config if second param is null or undefined - fixes #1006
1 parent 5577643 commit ac62359

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

lib/args.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,20 @@ module.exports = function (args) {
4141

4242
} else {
4343

44-
config = args[1] || {};
44+
if (args[1] === null || args[1] === undefined) {
4545

46-
if (!config.files) {
47-
config.files = args[0];
46+
config = args[0];
47+
48+
} else {
49+
50+
// finally, second arg could be a plain object for config
51+
config = args[1] || {};
52+
53+
if (!config.files) {
54+
config.files = args[0];
55+
}
4856
}
57+
4958
}
5059

5160
break;

0 commit comments

Comments
 (0)