diff --git a/services/file_service.ts b/services/file_service.ts index 6667e1b..1ecdff6 100644 --- a/services/file_service.ts +++ b/services/file_service.ts @@ -26,7 +26,7 @@ export default class FileService { const classEndIndex = fileLines.findLastIndex((line) => string.condenseWhitespace(line) === '}') const classLines = fileLines - .slice(classStartIndex + 1, classEndIndex - 1) + .slice(classStartIndex + 1, classEndIndex) .map((line) => string.condenseWhitespace(line)) let isInBlock: boolean = false diff --git a/test-files/expectations/some_test.txt b/test-files/expectations/some_test.txt index 4b86d70..f149f1e 100644 --- a/test-files/expectations/some_test.txt +++ b/test-files/expectations/some_test.txt @@ -4,6 +4,7 @@ import Test from '#models/test' export default class SomeTestDto extends BaseModelDto { declare id: number declare createdAt: string + declare updatedAt: string constructor(test?: Test) { super() @@ -11,5 +12,6 @@ export default class SomeTestDto extends BaseModelDto { if (!test) return this.id = test.id this.createdAt = test.createdAt.toISO()! + this.updatedAt = test.updatedAt.toISO()! } } diff --git a/test-files/expectations/test.txt b/test-files/expectations/test.txt index 1b2560a..1b52de9 100644 --- a/test-files/expectations/test.txt +++ b/test-files/expectations/test.txt @@ -4,6 +4,7 @@ import Test from '#models/test' export default class TestDto extends BaseModelDto { declare id: number declare createdAt: string + declare updatedAt: string constructor(test?: Test) { super() @@ -11,5 +12,6 @@ export default class TestDto extends BaseModelDto { if (!test) return this.id = test.id this.createdAt = test.createdAt.toISO()! + this.updatedAt = test.updatedAt.toISO()! } } diff --git a/test-files/expectations/user.txt b/test-files/expectations/user.txt index ad5fffa..65c8668 100644 --- a/test-files/expectations/user.txt +++ b/test-files/expectations/user.txt @@ -5,6 +5,7 @@ import TransactionDto from '#dtos/transaction' import IncomeDto from '#dtos/income' import StockPurchaseDto from '#dtos/stock_purchase' import StockDto from '#dtos/stock' +import AccountDto from '#dtos/account' export default class UserDto extends BaseModelDto { declare id: number @@ -18,6 +19,7 @@ export default class UserDto extends BaseModelDto { declare incomes: IncomeDto[] declare stockPurchases: StockPurchaseDto[] declare stocks: StockDto[] + declare accounts: AccountDto[] constructor(user?: User) { super() @@ -34,5 +36,6 @@ export default class UserDto extends BaseModelDto { this.incomes = IncomeDto.fromArray(user.incomes) this.stockPurchases = StockPurchaseDto.fromArray(user.stockPurchases) this.stocks = StockDto.fromArray(user.stocks) + this.accounts = AccountDto.fromArray(user.accounts) } }