Skip to content

Commit 0e3478b

Browse files
authored
refactor: use optional chaining in template validator (#1300)
1 parent 6f60d50 commit 0e3478b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

apps/generator/lib/templateConfigValidator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ function getParamSuggestion(wrongParam, configParams) {
9797
* @param {Object} templateParams All parameters provided to generator
9898
*/
9999
function isProvidedParameterSupported(configParams, templateParams) {
100-
const wrongParams = Object.keys(templateParams || {}).filter(key => !configParams || !configParams[key]);
100+
const wrongParams = Object.keys(templateParams || {}).filter(key => !configParams?.[key]);
101101

102102
if (!wrongParams.length) return;
103103
if (!configParams) throw new Error('This template doesn\'t have any params.');

0 commit comments

Comments
 (0)