Skip to content

Commit

Permalink
using optinal chaining expression
Browse files Browse the repository at this point in the history
  • Loading branch information
thebedigupta committed Oct 10, 2024
1 parent 6f60d50 commit e0b7a7c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion apps/generator/lib/templateConfigValidator.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ function getParamSuggestion(wrongParam, configParams) {
* @param {Object} templateParams All parameters provided to generator
*/
function isProvidedParameterSupported(configParams, templateParams) {
const wrongParams = Object.keys(templateParams || {}).filter(key => !configParams || !configParams[key]);
const wrongParams = Object.keys(templateParams || {}).filter(key => !configParams?.[key]);

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

0 comments on commit e0b7a7c

Please sign in to comment.