diff --git a/packages/loot-core/src/server/importers/ynab5-types.d.ts b/packages/loot-core/src/server/importers/ynab5-types.d.ts index 45a63c44bd1..c96d06a093e 100644 --- a/packages/loot-core/src/server/importers/ynab5-types.d.ts +++ b/packages/loot-core/src/server/importers/ynab5-types.d.ts @@ -25,7 +25,7 @@ export namespace YNAB5 { id: string; name: string; deleted: boolean; - transfer_acct?: string + transfer_acct?: string; } interface CategoryGroup { diff --git a/packages/loot-core/src/server/importers/ynab5.ts b/packages/loot-core/src/server/importers/ynab5.ts index f2a899c630c..8641d82cb22 100644 --- a/packages/loot-core/src/server/importers/ynab5.ts +++ b/packages/loot-core/src/server/importers/ynab5.ts @@ -9,7 +9,6 @@ import * as monthUtils from '../../shared/months'; import { sortByKey, groupBy } from '../../shared/util'; import { YNAB5 } from './ynab5-types'; -import Payee = YNAB5.Payee; function amountFromYnab(amount: number) { // ynabs multiplies amount by 1000 and actual by 100 @@ -144,9 +143,12 @@ async function importTransactions( let transactionsGrouped = groupBy(data.transactions, 'account_id'); let subtransactionsGrouped = groupBy(data.subtransactions, 'transaction_id'); - const payeesByTransferAcct = payees.filter((payee: Payee) => payee?.transfer_acct) - .map((payee: Payee) => [payee.transfer_acct, payee]) - const payeeTransferAcctHashMap = new Map(payeesByTransferAcct); + const payeesByTransferAcct = payees + .filter((payee: YNAB5.Payee) => payee?.transfer_acct) + .map((payee: YNAB5.Payee) => [payee.transfer_acct, payee]); + const payeeTransferAcctHashMap = new Map( + payeesByTransferAcct, + ); // Go ahead and generate ids for all of the transactions so we can // reliably resolve transfers @@ -185,8 +187,12 @@ async function importTransactions( ? subtransactions.map(subtrans => { let payee = null; if (subtrans.transfer_account_id) { - const mappedTransferAccountId = entityIdMap.get(subtrans.transfer_account_id); - payee = payeeTransferAcctHashMap.get(mappedTransferAccountId)?.id; + const mappedTransferAccountId = entityIdMap.get( + subtrans.transfer_account_id, + ); + payee = payeeTransferAcctHashMap.get( + mappedTransferAccountId, + )?.id; } return {