From de6cb889b1fe00d05dc6bc1b9358f2f871906f7a Mon Sep 17 00:00:00 2001 From: Tom Gobich Date: Fri, 20 Sep 2024 07:52:20 -0400 Subject: [PATCH] fixed(stub): issue where stub generates with non-default and trailing spaces --- stubs/generate/model.stub | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/stubs/generate/model.stub b/stubs/generate/model.stub index 4c6ca1a..646a0c5 100644 --- a/stubs/generate/model.stub +++ b/stubs/generate/model.stub @@ -1,10 +1,10 @@ {{ #each model.imports as statement }} {{ statement }}{{{ '\n' }}} {{ /each }} -export default class {{ model.name }} extends BaseModel {{ '{' }}{{ #each model.columns as column }} +export default class {{ model.name }} extends BaseModel {{ '{' }}{{ #each model.columns as column, index }} {{ column.getDecorator() }} - declare {{ column.name }}: {{ column.type }}{{ column.isNullable ? ' | null' : '' }} - {{ /each }}{{ #each model.relationships as relationship, index }} + declare {{ column.name }}: {{ column.type }}{{ column.isNullable ? ' | null' : '' }}{{ index + 1 < model.columns.length || model.relationships.length ? '\n' : '' }} +{{ /each }}{{ #each model.relationships as relationship, index }} {{ relationship.decorator }} {{{ relationship.property }}}{{ index + 1 < model.relationships.length ? '\n' : '' }} {{ /each }}