Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
(acc: BalanceAsInputStringT, code: string) => {
acc[code] = Currency.centsToString(account.balance[code], code, false);
return acc;
},
{}
export function stateToForm(state: TransactionStateT): TransactionFormT {
return {
...state,
amount: Currency.centsToString(
state.amount * (state.kind === Expense ? -1 : 1),
state.currency,
false
),
linkedAmount:
state.kind === Transfer && state.linkedAmount && state.linkedCurrency
? Currency.centsToString(
state.linkedAmount,
state.linkedCurrency,
false
)
: undefined,
note: state.note || '',
tags: {
[Expense]: [],
[Income]: [],
export function stateToForm(state: TransactionStateT): TransactionFormT {
return {
...state,
amount: Currency.centsToString(
state.amount * (state.kind === Expense ? -1 : 1),
state.currency,
false
),
linkedAmount:
state.kind === Transfer && state.linkedAmount && state.linkedCurrency
? Currency.centsToString(
state.linkedAmount,
state.linkedCurrency,
false
)
: undefined,
note: state.note || '',
tags: {
[Expense]: [],
[Income]: [],
[state.kind]: state.tags || []
},
date: format(toLocalTimestamp(state.date), 'YYYY-MM-DD')
};
}