yeoman-environment 3.18.0 → 3.18.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -92,7 +92,7 @@ const getInstantiateOptions = (args, options) => {
92
92
 
93
93
  if ('options' in args || 'arguments' in args || 'args' in args) {
94
94
  const {args: insideArgs, arguments: generatorArgs = insideArgs, options: generatorOptions, ...remainingOptions} = args;
95
- return {generatorArgs: splitArgsFromString(generatorArgs), generatorOptions: generatorOptions ?? remainingOptions};
95
+ return {generatorArgs: splitArgsFromString(generatorArgs), generatorOptions: generatorOptions || remainingOptions};
96
96
  }
97
97
  }
98
98
 
@@ -112,14 +112,18 @@ const getComposeOptions = (...varargs) => {
112
112
  let generatorArgs;
113
113
  let generatorOptions;
114
114
  if (args !== undefined) {
115
- if (typeof args === 'object') {
115
+ if (Array.isArray(args)) {
116
+ generatorArgs = args;
117
+ } else if (typeof args === 'string') {
118
+ generatorArgs = splitArgsFromString(String(args));
119
+ } else if (typeof args === 'object') {
116
120
  if ('generatorOptions' in args || 'generatorArgs' in args || 'schedule' in args) {
117
121
  return args;
118
122
  }
119
123
 
120
124
  generatorOptions = args;
121
125
  } else {
122
- generatorArgs = Array.isArray(args) ? args : splitArgsFromString(String(args));
126
+ throw new TypeError(`Parameter args if type ${typeof args} is not supported`);
123
127
  }
124
128
  }
125
129
 
@@ -127,7 +131,7 @@ const getComposeOptions = (...varargs) => {
127
131
  return {generatorArgs, generatorOptions, schedule: options};
128
132
  }
129
133
 
130
- generatorOptions = generatorOptions ?? options;
134
+ generatorOptions = generatorOptions || options;
131
135
 
132
136
  if (typeof composeOptions === 'boolean') {
133
137
  return {generatorArgs, generatorOptions, schedule: composeOptions};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yeoman-environment",
3
- "version": "3.18.0",
3
+ "version": "3.18.1",
4
4
  "description": "Handles the lifecyle and bootstrapping of generators in a specific environment",
5
5
  "homepage": "http://yeoman.io",
6
6
  "author": "Yeoman",