We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent edec35a commit 181ac33Copy full SHA for 181ac33
src/internals.js
@@ -102,10 +102,23 @@ function collect(val, memo) {
102
return memo;
103
}
104
105
+function ensureArray(arg) {
106
+ if (arg === undefined || arg === null || arg === '') {
107
+ return [];
108
+ }
109
+
110
+ if (!Array.isArray(arg)) {
111
+ return [arg];
112
113
114
+ return arg;
115
+}
116
117
module.exports = {
118
preprocessArgs,
119
fileExists,
120
parseConfigActions,
121
parseConfig,
- collect
122
+ collect,
123
+ ensureArray
124
};
0 commit comments