Skip to content

Commit

Permalink
fix: Add enumerable to template parameters (#322)
Browse files Browse the repository at this point in the history
Co-authored-by: Semen Tenishchev <[email protected]>
  • Loading branch information
Tenischev and Semen Tenishchev authored Apr 30, 2020
1 parent b7931cc commit 48a0c2d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ class Generator {
Object.keys(templateParams).forEach(key => {
const self = this;
Object.defineProperty(this.templateParams, key, {
enumerable: true,
get() {
if (!self.templateConfig.parameters || !self.templateConfig.parameters[key]) {
throw new Error(`Template parameter "${key}" has not been defined in the .tp-config.json file. Please make sure it's listed there before you use it in your template.`);
Expand Down

0 comments on commit 48a0c2d

Please sign in to comment.