moneyfunx 1.0.9 → 1.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -106,7 +106,7 @@ export function payLoans(loans, payment, reduceMinimum = false) {
106
106
  // handle calculating information for the rest of the loans
107
107
  loans.slice(paidLoans).forEach((loan, index) => {
108
108
  const loanPrincipalRemaining = loanPrincipalsRemaining[loan.id];
109
- const paidPeriods = amortizePayments(loan, loanPrincipalRemaining, loan.minPayment, periodsToPay, periodsElapsed, index === 0 ? firstLoanCarryover : 0);
109
+ const paidPeriods = amortizePayments(loan, loanPrincipalRemaining, loan.minPayment, periodsToPay, periodsElapsed, (index === 0 && !reduceMinimum) ? firstLoanCarryover : 0);
110
110
  paymentData[loan.id].amortizationSchedule = [
111
111
  ...paymentData[loan.id].amortizationSchedule,
112
112
  ...paidPeriods,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "moneyfunx",
3
3
  "type": "module",
4
- "version": "1.0.9",
4
+ "version": "1.0.10",
5
5
  "description": "MoneyFunx is a small library of functions for financial computations, with a focus on personal finance",
6
6
  "main": "build/index.js",
7
7
  "types": "build/index.d.ts",
@@ -172,7 +172,7 @@ export function payLoans(
172
172
  loan.minPayment,
173
173
  periodsToPay,
174
174
  periodsElapsed,
175
- index === 0 ? firstLoanCarryover : 0
175
+ (index === 0 && !reduceMinimum) ? firstLoanCarryover : 0
176
176
  );
177
177
  paymentData[loan.id].amortizationSchedule = [
178
178
  ...paymentData[loan.id].amortizationSchedule,