From 950d0b665f0f2ca0cb984bc0ca4749e85aeff4b0 Mon Sep 17 00:00:00 2001 From: Erik Erikson Date: Mon, 14 Mar 2016 13:59:02 -0700 Subject: [PATCH] Tiny changes to allow for falsy values to be used in templates and variables. --- lib/utils/index.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/utils/index.js b/lib/utils/index.js index 4bd36f657..942f82182 100644 --- a/lib/utils/index.js +++ b/lib/utils/index.js @@ -326,12 +326,12 @@ module.exports = { 'Module level templates extend project level templates if there are duplicates. You will need to change: ' + template); } - if (!templates[template]) { + // Replace + if (template in templates) { + t.update(templates[template]); + } else { SCli.log('WARNING: the following template is requested but not defined: ' + template + (data.name ? ' in ' + data.name : '')); } - - // Replace - if (templates[template]) t.update(templates[template]); } }); @@ -351,7 +351,7 @@ module.exports = { let variableName = variableSyntax.replace(varTemplateSyntax, (match, varName) => varName.trim()); let value; - if (variablesObject[variableName]) { + if (variableName in variablesObject) { value = variablesObject[variableName]; } @@ -449,4 +449,4 @@ module.exports = { return functions; } -}; \ No newline at end of file +};