moneyfunx 1.2.3 → 1.2.4
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.
- package/build/lib/helperFunctions.d.ts +4 -12
- package/build/lib/helperFunctions.js +6 -14
- package/build/lib/payments.d.ts +3 -3
- package/build/lib/payments.js +3 -3
- package/build/lib/sorting.d.ts +12 -12
- package/build/lib/sorting.js +6 -6
- package/coverage/clover.xml +32 -32
- package/coverage/coverage-final.json +2 -2
- package/coverage/index.html +1 -1
- package/coverage/src/index.html +1 -1
- package/coverage/src/index.ts.html +1 -1
- package/coverage/src/lib/constants.ts.html +1 -1
- package/coverage/src/lib/errors.ts.html +1 -1
- package/coverage/src/lib/helperFunctions.ts.html +8 -32
- package/coverage/src/lib/index.html +1 -1
- package/coverage/src/lib/loan.ts.html +1 -1
- package/coverage/src/lib/paymentTypes.ts.html +1 -1
- package/coverage/src/lib/payments.ts.html +4 -4
- package/coverage/src/lib/sorting.ts.html +13 -13
- package/package.json +1 -1
- package/src/lib/helperFunctions.ts +6 -14
- package/src/lib/payments.ts +3 -3
- package/src/lib/sorting.ts +12 -12
|
@@ -6,10 +6,8 @@
|
|
|
6
6
|
/**
|
|
7
7
|
* Calculates the minimum payment to pay the principal back in the number of periods at the periodic rate
|
|
8
8
|
*
|
|
9
|
-
* balance = principal + interest
|
|
10
|
-
*
|
|
11
9
|
* @param {number} principal The amount borrowed
|
|
12
|
-
* @param {number} periodicRate The rate the
|
|
10
|
+
* @param {number} periodicRate The rate the principal accrues interest at per period
|
|
13
11
|
* @param {number [int]} periods The number of periods the principal is repaid over
|
|
14
12
|
* @returns {number} The minimum payment
|
|
15
13
|
*/
|
|
@@ -17,11 +15,9 @@ export declare function calculateMinPayment(principal: number, periodicRate: num
|
|
|
17
15
|
/**
|
|
18
16
|
* Calculates the principal remaining after a certain number of payments from a beginning principal at a periodic rate
|
|
19
17
|
*
|
|
20
|
-
* balance = principal + interest
|
|
21
|
-
*
|
|
22
18
|
* @param {number} principal The amount borrowed
|
|
23
19
|
* @param {number} payment The amount paid at each period
|
|
24
|
-
* @param {number} periodicRate The rate the
|
|
20
|
+
* @param {number} periodicRate The rate the princpal accrues interest at per period
|
|
25
21
|
* @param {number [int]} periods The number of periods paid to compute the desired principal remaining
|
|
26
22
|
* @returns {number} The remaining principal
|
|
27
23
|
*/
|
|
@@ -29,11 +25,9 @@ export declare function principalRemaining(principal: number, payment: number, p
|
|
|
29
25
|
/**
|
|
30
26
|
* Calculates the total interest paid after a certain number of payments from a beginning principal at a periodic rate
|
|
31
27
|
*
|
|
32
|
-
* balance = principal + interest
|
|
33
|
-
*
|
|
34
28
|
* @param {number} principal The amount borrowed
|
|
35
29
|
* @param {number} payment The amount paid at each period
|
|
36
|
-
* @param {number} periodicRate The rate the
|
|
30
|
+
* @param {number} periodicRate The rate the princpal accrues interest at per period
|
|
37
31
|
* @param {number [int]} periods The number of periods paid to compute the desired principal remaining
|
|
38
32
|
* @returns {number} The total interest paid
|
|
39
33
|
*/
|
|
@@ -41,11 +35,9 @@ export declare function interestPaid(principal: number, payment: number, periodi
|
|
|
41
35
|
/**
|
|
42
36
|
* Calculates the number of payments required to pay off a principal
|
|
43
37
|
*
|
|
44
|
-
* balance = principal + interest
|
|
45
|
-
*
|
|
46
38
|
* @param {number} principal The amount borrowed
|
|
47
39
|
* @param {number} payment The amount paid at each period
|
|
48
|
-
* @param {number} periodicRate The rate the
|
|
40
|
+
* @param {number} periodicRate The rate the princpal accrues interest at per period
|
|
49
41
|
* @returns The number of payments needed to pay off the principal
|
|
50
42
|
*/
|
|
51
43
|
export declare function numPaymentsToZero(principal: number, payment: number, periodicRate: number): number;
|
|
@@ -6,10 +6,8 @@
|
|
|
6
6
|
/**
|
|
7
7
|
* Calculates the minimum payment to pay the principal back in the number of periods at the periodic rate
|
|
8
8
|
*
|
|
9
|
-
* balance = principal + interest
|
|
10
|
-
*
|
|
11
9
|
* @param {number} principal The amount borrowed
|
|
12
|
-
* @param {number} periodicRate The rate the
|
|
10
|
+
* @param {number} periodicRate The rate the principal accrues interest at per period
|
|
13
11
|
* @param {number [int]} periods The number of periods the principal is repaid over
|
|
14
12
|
* @returns {number} The minimum payment
|
|
15
13
|
*/
|
|
@@ -23,26 +21,22 @@ export function calculateMinPayment(principal, periodicRate, periods) {
|
|
|
23
21
|
/**
|
|
24
22
|
* Calculates the principal remaining after a certain number of payments from a beginning principal at a periodic rate
|
|
25
23
|
*
|
|
26
|
-
* balance = principal + interest
|
|
27
|
-
*
|
|
28
24
|
* @param {number} principal The amount borrowed
|
|
29
25
|
* @param {number} payment The amount paid at each period
|
|
30
|
-
* @param {number} periodicRate The rate the
|
|
26
|
+
* @param {number} periodicRate The rate the princpal accrues interest at per period
|
|
31
27
|
* @param {number [int]} periods The number of periods paid to compute the desired principal remaining
|
|
32
28
|
* @returns {number} The remaining principal
|
|
33
29
|
*/
|
|
34
30
|
export function principalRemaining(principal, payment, periodicRate, periods) {
|
|
35
|
-
return Math.max(principal * Math.pow((1 + periodicRate), periods) -
|
|
36
|
-
payment * (
|
|
31
|
+
return Math.max((principal * Math.pow((1 + periodicRate), periods)) -
|
|
32
|
+
(payment * (Math.pow((1 + periodicRate), periods) - 1) / periodicRate), 0);
|
|
37
33
|
}
|
|
38
34
|
/**
|
|
39
35
|
* Calculates the total interest paid after a certain number of payments from a beginning principal at a periodic rate
|
|
40
36
|
*
|
|
41
|
-
* balance = principal + interest
|
|
42
|
-
*
|
|
43
37
|
* @param {number} principal The amount borrowed
|
|
44
38
|
* @param {number} payment The amount paid at each period
|
|
45
|
-
* @param {number} periodicRate The rate the
|
|
39
|
+
* @param {number} periodicRate The rate the princpal accrues interest at per period
|
|
46
40
|
* @param {number [int]} periods The number of periods paid to compute the desired principal remaining
|
|
47
41
|
* @returns {number} The total interest paid
|
|
48
42
|
*/
|
|
@@ -53,11 +47,9 @@ export function interestPaid(principal, payment, periodicRate, periods) {
|
|
|
53
47
|
/**
|
|
54
48
|
* Calculates the number of payments required to pay off a principal
|
|
55
49
|
*
|
|
56
|
-
* balance = principal + interest
|
|
57
|
-
*
|
|
58
50
|
* @param {number} principal The amount borrowed
|
|
59
51
|
* @param {number} payment The amount paid at each period
|
|
60
|
-
* @param {number} periodicRate The rate the
|
|
52
|
+
* @param {number} periodicRate The rate the princpal accrues interest at per period
|
|
61
53
|
* @returns The number of payments needed to pay off the principal
|
|
62
54
|
*/
|
|
63
55
|
export function numPaymentsToZero(principal, payment, periodicRate) {
|
package/build/lib/payments.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ import type { AmortizationRecord, LoansPaymentSchedule } from './paymentTypes';
|
|
|
10
10
|
* Calculates the extra amount in a payment after all loans' minimum payments are met
|
|
11
11
|
* Throws an exception if the payment provided is less than the collective minimum payments for all loans
|
|
12
12
|
*
|
|
13
|
-
* @param {
|
|
13
|
+
* @param {ILoan[]} loans The loans to allocate minimum payments
|
|
14
14
|
* @param {number} payment The amount to pay across all loans
|
|
15
15
|
* @returns {number} The extra amount of payment
|
|
16
16
|
*/
|
|
@@ -25,14 +25,14 @@ export declare function determineExtraPayment(loans: ILoan[], payment: number):
|
|
|
25
25
|
* @param {number} numPayments The number of periods to make payments to the loan
|
|
26
26
|
* @param {number} startPeriod An initial offset of periods to 'fast-forward' the state of the loan to prior to calculation of each period
|
|
27
27
|
* @param {number} carryover An additional amount to pay towards a loan, used when a residual amount is available from paying off the previous loan this period
|
|
28
|
-
* @returns {
|
|
28
|
+
* @returns {AmortizationRecord[]} The amortization schdule for the number of payments of payment made to the loan from the provided start period
|
|
29
29
|
*/
|
|
30
30
|
export declare function amortizePayments(loan: Loan, principal: number, payment: number, numPayments: number, startPeriod?: number, carryover?: number): AmortizationRecord[];
|
|
31
31
|
/**
|
|
32
32
|
*
|
|
33
33
|
* Calculates a wealth of information about paying of a set of loans with a total payment amount
|
|
34
34
|
*
|
|
35
|
-
* @param {
|
|
35
|
+
* @param {Loan[]} loans The loans to pay off
|
|
36
36
|
* @param {number} payment The total amount of money budgeted to pay all loans each period
|
|
37
37
|
* @param {boolean} reduceMinimum Flag to reduce the total payment amount by a loan's minimum when that loan is paid off
|
|
38
38
|
* @returns {LoansPaymentSchedule} Various totals and series of data regarding paying off the loans at the payment amount
|
package/build/lib/payments.js
CHANGED
|
@@ -10,7 +10,7 @@ import * as helpers from './helperFunctions';
|
|
|
10
10
|
* Calculates the extra amount in a payment after all loans' minimum payments are met
|
|
11
11
|
* Throws an exception if the payment provided is less than the collective minimum payments for all loans
|
|
12
12
|
*
|
|
13
|
-
* @param {
|
|
13
|
+
* @param {ILoan[]} loans The loans to allocate minimum payments
|
|
14
14
|
* @param {number} payment The amount to pay across all loans
|
|
15
15
|
* @returns {number} The extra amount of payment
|
|
16
16
|
*/
|
|
@@ -32,7 +32,7 @@ export function determineExtraPayment(loans, payment) {
|
|
|
32
32
|
* @param {number} numPayments The number of periods to make payments to the loan
|
|
33
33
|
* @param {number} startPeriod An initial offset of periods to 'fast-forward' the state of the loan to prior to calculation of each period
|
|
34
34
|
* @param {number} carryover An additional amount to pay towards a loan, used when a residual amount is available from paying off the previous loan this period
|
|
35
|
-
* @returns {
|
|
35
|
+
* @returns {AmortizationRecord[]} The amortization schdule for the number of payments of payment made to the loan from the provided start period
|
|
36
36
|
*/
|
|
37
37
|
export function amortizePayments(loan, principal, payment, numPayments, startPeriod = 0, carryover = 0) {
|
|
38
38
|
if (payment === null) {
|
|
@@ -63,7 +63,7 @@ export function amortizePayments(loan, principal, payment, numPayments, startPer
|
|
|
63
63
|
*
|
|
64
64
|
* Calculates a wealth of information about paying of a set of loans with a total payment amount
|
|
65
65
|
*
|
|
66
|
-
* @param {
|
|
66
|
+
* @param {Loan[]} loans The loans to pay off
|
|
67
67
|
* @param {number} payment The total amount of money budgeted to pay all loans each period
|
|
68
68
|
* @param {boolean} reduceMinimum Flag to reduce the total payment amount by a loan's minimum when that loan is paid off
|
|
69
69
|
* @returns {LoansPaymentSchedule} Various totals and series of data regarding paying off the loans at the payment amount
|
package/build/lib/sorting.d.ts
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
/**
|
|
2
2
|
*
|
|
3
|
-
* This file contains functions for sorting Arrays of
|
|
3
|
+
* This file contains functions for sorting Arrays of ILoans on certain attributes
|
|
4
4
|
*
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
7
|
-
type avalanche = (loan1:
|
|
8
|
-
type snowball = (loan1:
|
|
6
|
+
import { ILoan } from './loan';
|
|
7
|
+
type avalanche = (loan1: ILoan, loan2: ILoan) => number;
|
|
8
|
+
type snowball = (loan1: ILoan, loan2: ILoan) => number;
|
|
9
9
|
type sortFunction = avalanche | snowball;
|
|
10
10
|
/**
|
|
11
11
|
* Sorts loans descending by interest rate
|
|
12
|
-
* @param {
|
|
13
|
-
* @param {
|
|
12
|
+
* @param {ILoan} loan1 A loan to be comapred
|
|
13
|
+
* @param {ILoan} loan2 A loan to be comapred
|
|
14
14
|
* @returns {number} the order in which to sort the loans in descending interest rate
|
|
15
15
|
*/
|
|
16
|
-
export declare function avalanche(loan1:
|
|
16
|
+
export declare function avalanche(loan1: ILoan, loan2: ILoan): number;
|
|
17
17
|
/**
|
|
18
18
|
* Sorts loans ascending by principal
|
|
19
|
-
* @param {
|
|
20
|
-
* @param {
|
|
19
|
+
* @param {ILoan} loan1 A loan to be compared
|
|
20
|
+
* @param {ILoan} loan2 A loan to be compared
|
|
21
21
|
* @returns {number} the order in which to sort the loans in ascending princpal
|
|
22
22
|
*/
|
|
23
|
-
export declare function snowball(loan1:
|
|
23
|
+
export declare function snowball(loan1: ILoan, loan2: ILoan): number;
|
|
24
24
|
/**
|
|
25
25
|
* Sorts an array of loans using the provided sortFunc
|
|
26
|
-
* @param {
|
|
26
|
+
* @param {ILoan[]} loans The loans to sort
|
|
27
27
|
* @param {function} sortFunc The algorithm to sort the loans with
|
|
28
28
|
* @returns The sorted array loans
|
|
29
29
|
*/
|
|
30
|
-
export declare function sortLoans(loans:
|
|
30
|
+
export declare function sortLoans(loans: ILoan[], sortFunction: sortFunction): ILoan[];
|
|
31
31
|
export {};
|
package/build/lib/sorting.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
*
|
|
3
|
-
* This file contains functions for sorting Arrays of
|
|
3
|
+
* This file contains functions for sorting Arrays of ILoans on certain attributes
|
|
4
4
|
*
|
|
5
5
|
*/
|
|
6
6
|
/**
|
|
7
7
|
* Sorts loans descending by interest rate
|
|
8
|
-
* @param {
|
|
9
|
-
* @param {
|
|
8
|
+
* @param {ILoan} loan1 A loan to be comapred
|
|
9
|
+
* @param {ILoan} loan2 A loan to be comapred
|
|
10
10
|
* @returns {number} the order in which to sort the loans in descending interest rate
|
|
11
11
|
*/
|
|
12
12
|
export function avalanche(loan1, loan2) {
|
|
@@ -14,8 +14,8 @@ export function avalanche(loan1, loan2) {
|
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
16
|
* Sorts loans ascending by principal
|
|
17
|
-
* @param {
|
|
18
|
-
* @param {
|
|
17
|
+
* @param {ILoan} loan1 A loan to be compared
|
|
18
|
+
* @param {ILoan} loan2 A loan to be compared
|
|
19
19
|
* @returns {number} the order in which to sort the loans in ascending princpal
|
|
20
20
|
*/
|
|
21
21
|
export function snowball(loan1, loan2) {
|
|
@@ -23,7 +23,7 @@ export function snowball(loan1, loan2) {
|
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
25
25
|
* Sorts an array of loans using the provided sortFunc
|
|
26
|
-
* @param {
|
|
26
|
+
* @param {ILoan[]} loans The loans to sort
|
|
27
27
|
* @param {function} sortFunc The algorithm to sort the loans with
|
|
28
28
|
* @returns The sorted array loans
|
|
29
29
|
*/
|
package/coverage/clover.xml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<coverage generated="
|
|
3
|
-
<project timestamp="
|
|
2
|
+
<coverage generated="1739747430257" clover="3.2.0">
|
|
3
|
+
<project timestamp="1739747430258" name="All files">
|
|
4
4
|
<metrics statements="328" coveredstatements="328" conditionals="49" coveredconditionals="49" methods="18" coveredmethods="18" elements="395" coveredelements="395" complexity="0" loc="328" ncloc="328" packages="2" files="8" classes="8"/>
|
|
5
5
|
<package name="src">
|
|
6
6
|
<metrics statements="7" coveredstatements="7" conditionals="0" coveredconditionals="0" methods="0" coveredmethods="0"/>
|
|
@@ -33,18 +33,22 @@
|
|
|
33
33
|
</file>
|
|
34
34
|
<file name="helperFunctions.ts" path="/home/runner/work/moneyfunx/moneyfunx/src/lib/helperFunctions.ts">
|
|
35
35
|
<metrics statements="43" coveredstatements="43" conditionals="6" coveredconditionals="6" methods="4" coveredmethods="4"/>
|
|
36
|
-
<line num="
|
|
36
|
+
<line num="15" count="1" type="cond" truecount="1" falsecount="0"/>
|
|
37
|
+
<line num="16" count="9" type="stmt"/>
|
|
38
|
+
<line num="17" count="9" type="stmt"/>
|
|
37
39
|
<line num="18" count="9" type="stmt"/>
|
|
38
40
|
<line num="19" count="9" type="stmt"/>
|
|
39
|
-
<line num="20" count="9" type="
|
|
40
|
-
<line num="21" count="
|
|
41
|
-
<line num="22" count="
|
|
42
|
-
<line num="23" count="8" type="
|
|
43
|
-
<line num="24" count="
|
|
44
|
-
<line num="25" count="
|
|
45
|
-
<line num="
|
|
46
|
-
<line num="
|
|
47
|
-
<line num="
|
|
41
|
+
<line num="20" count="9" type="cond" truecount="1" falsecount="0"/>
|
|
42
|
+
<line num="21" count="8" type="stmt"/>
|
|
43
|
+
<line num="22" count="8" type="stmt"/>
|
|
44
|
+
<line num="23" count="8" type="cond" truecount="1" falsecount="0"/>
|
|
45
|
+
<line num="24" count="1" type="stmt"/>
|
|
46
|
+
<line num="25" count="9" type="stmt"/>
|
|
47
|
+
<line num="36" count="1" type="cond" truecount="1" falsecount="0"/>
|
|
48
|
+
<line num="37" count="30" type="stmt"/>
|
|
49
|
+
<line num="38" count="30" type="stmt"/>
|
|
50
|
+
<line num="39" count="30" type="stmt"/>
|
|
51
|
+
<line num="40" count="30" type="stmt"/>
|
|
48
52
|
<line num="41" count="30" type="stmt"/>
|
|
49
53
|
<line num="42" count="30" type="stmt"/>
|
|
50
54
|
<line num="43" count="30" type="stmt"/>
|
|
@@ -52,30 +56,26 @@
|
|
|
52
56
|
<line num="45" count="30" type="stmt"/>
|
|
53
57
|
<line num="46" count="30" type="stmt"/>
|
|
54
58
|
<line num="47" count="30" type="stmt"/>
|
|
55
|
-
<line num="
|
|
56
|
-
<line num="
|
|
57
|
-
<line num="
|
|
58
|
-
<line num="
|
|
59
|
-
<line num="
|
|
59
|
+
<line num="58" count="1" type="cond" truecount="1" falsecount="0"/>
|
|
60
|
+
<line num="59" count="9" type="stmt"/>
|
|
61
|
+
<line num="60" count="9" type="stmt"/>
|
|
62
|
+
<line num="61" count="9" type="stmt"/>
|
|
63
|
+
<line num="62" count="9" type="stmt"/>
|
|
64
|
+
<line num="63" count="9" type="stmt"/>
|
|
65
|
+
<line num="64" count="9" type="stmt"/>
|
|
60
66
|
<line num="65" count="9" type="stmt"/>
|
|
61
67
|
<line num="66" count="9" type="stmt"/>
|
|
62
|
-
<line num="67" count="9" type="stmt"/>
|
|
63
68
|
<line num="68" count="9" type="stmt"/>
|
|
64
|
-
<line num="
|
|
65
|
-
<line num="
|
|
66
|
-
<line num="
|
|
67
|
-
<line num="
|
|
68
|
-
<line num="
|
|
69
|
-
<line num="
|
|
69
|
+
<line num="78" count="1" type="cond" truecount="1" falsecount="0"/>
|
|
70
|
+
<line num="79" count="49" type="stmt"/>
|
|
71
|
+
<line num="80" count="49" type="stmt"/>
|
|
72
|
+
<line num="81" count="49" type="stmt"/>
|
|
73
|
+
<line num="82" count="49" type="stmt"/>
|
|
74
|
+
<line num="83" count="49" type="stmt"/>
|
|
75
|
+
<line num="84" count="49" type="stmt"/>
|
|
76
|
+
<line num="85" count="49" type="stmt"/>
|
|
77
|
+
<line num="86" count="49" type="stmt"/>
|
|
70
78
|
<line num="87" count="49" type="stmt"/>
|
|
71
|
-
<line num="88" count="49" type="stmt"/>
|
|
72
|
-
<line num="89" count="49" type="stmt"/>
|
|
73
|
-
<line num="90" count="49" type="stmt"/>
|
|
74
|
-
<line num="91" count="49" type="stmt"/>
|
|
75
|
-
<line num="92" count="49" type="stmt"/>
|
|
76
|
-
<line num="93" count="49" type="stmt"/>
|
|
77
|
-
<line num="94" count="49" type="stmt"/>
|
|
78
|
-
<line num="95" count="49" type="stmt"/>
|
|
79
79
|
</file>
|
|
80
80
|
<file name="loan.ts" path="/home/runner/work/moneyfunx/moneyfunx/src/lib/loan.ts">
|
|
81
81
|
<metrics statements="84" coveredstatements="84" conditionals="15" coveredconditionals="15" methods="7" coveredmethods="7"/>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{"/home/runner/work/moneyfunx/moneyfunx/src/index.ts": {"path":"/home/runner/work/moneyfunx/moneyfunx/src/index.ts","all":false,"statementMap":{"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":41}},"2":{"start":{"line":3,"column":0},"end":{"line":3,"column":50}},"3":{"start":{"line":4,"column":0},"end":{"line":4,"column":8}},"9":{"start":{"line":10,"column":0},"end":{"line":10,"column":41}},"10":{"start":{"line":11,"column":0},"end":{"line":11,"column":8}},"15":{"start":{"line":16,"column":0},"end":{"line":16,"column":8}},"21":{"start":{"line":22,"column":0},"end":{"line":22,"column":63}}},"s":{"1":1,"2":1,"3":1,"9":1,"10":1,"15":1,"21":1},"branchMap":{},"b":{},"fnMap":{},"f":{}}
|
|
2
2
|
,"/home/runner/work/moneyfunx/moneyfunx/src/lib/constants.ts": {"path":"/home/runner/work/moneyfunx/moneyfunx/src/lib/constants.ts","all":false,"statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}},"s":{"0":1},"branchMap":{},"b":{},"fnMap":{},"f":{}}
|
|
3
3
|
,"/home/runner/work/moneyfunx/moneyfunx/src/lib/errors.ts": {"path":"/home/runner/work/moneyfunx/moneyfunx/src/lib/errors.ts","all":false,"statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":47}},"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":32}},"2":{"start":{"line":3,"column":0},"end":{"line":3,"column":19}},"3":{"start":{"line":4,"column":0},"end":{"line":4,"column":62}},"4":{"start":{"line":5,"column":0},"end":{"line":5,"column":37}},"5":{"start":{"line":6,"column":0},"end":{"line":6,"column":3}},"6":{"start":{"line":7,"column":0},"end":{"line":7,"column":1}}},"s":{"0":1,"1":1,"2":11,"3":11,"4":11,"5":11,"6":1},"branchMap":{"0":{"type":"branch","line":2,"loc":{"start":{"line":2,"column":2},"end":{"line":6,"column":3}},"locations":[{"start":{"line":2,"column":2},"end":{"line":6,"column":3}}]}},"b":{"0":[11]},"fnMap":{"0":{"name":"PaymentTooLowError","decl":{"start":{"line":2,"column":2},"end":{"line":6,"column":3}},"loc":{"start":{"line":2,"column":2},"end":{"line":6,"column":3}},"line":2}},"f":{"0":11}}
|
|
4
|
-
,"/home/runner/work/moneyfunx/moneyfunx/src/lib/helperFunctions.ts": {"path":"/home/runner/work/moneyfunx/moneyfunx/src/lib/helperFunctions.ts","all":false,"statementMap":{"
|
|
4
|
+
,"/home/runner/work/moneyfunx/moneyfunx/src/lib/helperFunctions.ts": {"path":"/home/runner/work/moneyfunx/moneyfunx/src/lib/helperFunctions.ts","all":false,"statementMap":{"14":{"start":{"line":15,"column":0},"end":{"line":15,"column":36}},"15":{"start":{"line":16,"column":0},"end":{"line":16,"column":20}},"16":{"start":{"line":17,"column":0},"end":{"line":17,"column":23}},"17":{"start":{"line":18,"column":0},"end":{"line":18,"column":17}},"18":{"start":{"line":19,"column":0},"end":{"line":19,"column":11}},"19":{"start":{"line":20,"column":0},"end":{"line":20,"column":25}},"20":{"start":{"line":21,"column":0},"end":{"line":21,"column":17}},"21":{"start":{"line":22,"column":0},"end":{"line":22,"column":53}},"22":{"start":{"line":23,"column":0},"end":{"line":23,"column":42}},"23":{"start":{"line":24,"column":0},"end":{"line":24,"column":26}},"24":{"start":{"line":25,"column":0},"end":{"line":25,"column":1}},"35":{"start":{"line":36,"column":0},"end":{"line":36,"column":35}},"36":{"start":{"line":37,"column":0},"end":{"line":37,"column":20}},"37":{"start":{"line":38,"column":0},"end":{"line":38,"column":18}},"38":{"start":{"line":39,"column":0},"end":{"line":39,"column":23}},"39":{"start":{"line":40,"column":0},"end":{"line":40,"column":17}},"40":{"start":{"line":41,"column":0},"end":{"line":41,"column":11}},"41":{"start":{"line":42,"column":0},"end":{"line":42,"column":18}},"42":{"start":{"line":43,"column":0},"end":{"line":43,"column":49}},"43":{"start":{"line":44,"column":0},"end":{"line":44,"column":67}},"44":{"start":{"line":45,"column":0},"end":{"line":45,"column":5}},"45":{"start":{"line":46,"column":0},"end":{"line":46,"column":4}},"46":{"start":{"line":47,"column":0},"end":{"line":47,"column":1}},"57":{"start":{"line":58,"column":0},"end":{"line":58,"column":29}},"58":{"start":{"line":59,"column":0},"end":{"line":59,"column":20}},"59":{"start":{"line":60,"column":0},"end":{"line":60,"column":18}},"60":{"start":{"line":61,"column":0},"end":{"line":61,"column":23}},"61":{"start":{"line":62,"column":0},"end":{"line":62,"column":17}},"62":{"start":{"line":63,"column":0},"end":{"line":63,"column":11}},"63":{"start":{"line":64,"column":0},"end":{"line":64,"column":10}},"64":{"start":{"line":65,"column":0},"end":{"line":65,"column":23}},"65":{"start":{"line":66,"column":0},"end":{"line":66,"column":79}},"67":{"start":{"line":68,"column":0},"end":{"line":68,"column":1}},"77":{"start":{"line":78,"column":0},"end":{"line":78,"column":34}},"78":{"start":{"line":79,"column":0},"end":{"line":79,"column":20}},"79":{"start":{"line":80,"column":0},"end":{"line":80,"column":18}},"80":{"start":{"line":81,"column":0},"end":{"line":81,"column":22}},"81":{"start":{"line":82,"column":0},"end":{"line":82,"column":11}},"82":{"start":{"line":83,"column":0},"end":{"line":83,"column":19}},"83":{"start":{"line":84,"column":0},"end":{"line":84,"column":62}},"84":{"start":{"line":85,"column":0},"end":{"line":85,"column":30}},"85":{"start":{"line":86,"column":0},"end":{"line":86,"column":4}},"86":{"start":{"line":87,"column":0},"end":{"line":87,"column":1}}},"s":{"14":1,"15":9,"16":9,"17":9,"18":9,"19":9,"20":8,"21":8,"22":8,"23":1,"24":9,"35":1,"36":30,"37":30,"38":30,"39":30,"40":30,"41":30,"42":30,"43":30,"44":30,"45":30,"46":30,"57":1,"58":9,"59":9,"60":9,"61":9,"62":9,"63":9,"64":9,"65":9,"67":9,"77":1,"78":49,"79":49,"80":49,"81":49,"82":49,"83":49,"84":49,"85":49,"86":49},"branchMap":{"0":{"type":"branch","line":15,"loc":{"start":{"line":15,"column":7},"end":{"line":25,"column":1}},"locations":[{"start":{"line":15,"column":7},"end":{"line":25,"column":1}}]},"1":{"type":"branch","line":20,"loc":{"start":{"line":20,"column":24},"end":{"line":23,"column":42}},"locations":[{"start":{"line":20,"column":24},"end":{"line":23,"column":42}}]},"2":{"type":"branch","line":23,"loc":{"start":{"line":23,"column":39},"end":{"line":24,"column":26}},"locations":[{"start":{"line":23,"column":39},"end":{"line":24,"column":26}}]},"3":{"type":"branch","line":36,"loc":{"start":{"line":36,"column":7},"end":{"line":47,"column":1}},"locations":[{"start":{"line":36,"column":7},"end":{"line":47,"column":1}}]},"4":{"type":"branch","line":58,"loc":{"start":{"line":58,"column":7},"end":{"line":68,"column":1}},"locations":[{"start":{"line":58,"column":7},"end":{"line":68,"column":1}}]},"5":{"type":"branch","line":78,"loc":{"start":{"line":78,"column":7},"end":{"line":87,"column":1}},"locations":[{"start":{"line":78,"column":7},"end":{"line":87,"column":1}}]}},"b":{"0":[9],"1":[8],"2":[1],"3":[30],"4":[9],"5":[49]},"fnMap":{"0":{"name":"calculateMinPayment","decl":{"start":{"line":15,"column":7},"end":{"line":25,"column":1}},"loc":{"start":{"line":15,"column":7},"end":{"line":25,"column":1}},"line":15},"1":{"name":"principalRemaining","decl":{"start":{"line":36,"column":7},"end":{"line":47,"column":1}},"loc":{"start":{"line":36,"column":7},"end":{"line":47,"column":1}},"line":36},"2":{"name":"interestPaid","decl":{"start":{"line":58,"column":7},"end":{"line":68,"column":1}},"loc":{"start":{"line":58,"column":7},"end":{"line":68,"column":1}},"line":58},"3":{"name":"numPaymentsToZero","decl":{"start":{"line":78,"column":7},"end":{"line":87,"column":1}},"loc":{"start":{"line":78,"column":7},"end":{"line":87,"column":1}},"line":78}},"f":{"0":9,"1":30,"2":9,"3":49}}
|
|
5
5
|
,"/home/runner/work/moneyfunx/moneyfunx/src/lib/loan.ts": {"path":"/home/runner/work/moneyfunx/moneyfunx/src/lib/loan.ts","all":false,"statementMap":{"12":{"start":{"line":13,"column":0},"end":{"line":13,"column":35}},"13":{"start":{"line":14,"column":0},"end":{"line":14,"column":45}},"32":{"start":{"line":33,"column":0},"end":{"line":33,"column":36}},"55":{"start":{"line":56,"column":0},"end":{"line":56,"column":14}},"56":{"start":{"line":57,"column":0},"end":{"line":57,"column":22}},"57":{"start":{"line":58,"column":0},"end":{"line":58,"column":23}},"58":{"start":{"line":59,"column":0},"end":{"line":59,"column":27}},"59":{"start":{"line":60,"column":0},"end":{"line":60,"column":24}},"60":{"start":{"line":61,"column":0},"end":{"line":61,"column":17}},"61":{"start":{"line":62,"column":0},"end":{"line":62,"column":28}},"62":{"start":{"line":63,"column":0},"end":{"line":63,"column":18}},"63":{"start":{"line":64,"column":0},"end":{"line":64,"column":5}},"64":{"start":{"line":65,"column":0},"end":{"line":65,"column":61}},"65":{"start":{"line":66,"column":0},"end":{"line":66,"column":21}},"66":{"start":{"line":67,"column":0},"end":{"line":67,"column":31}},"67":{"start":{"line":68,"column":0},"end":{"line":68,"column":33}},"68":{"start":{"line":69,"column":0},"end":{"line":69,"column":41}},"69":{"start":{"line":70,"column":0},"end":{"line":70,"column":35}},"70":{"start":{"line":71,"column":0},"end":{"line":71,"column":62}},"71":{"start":{"line":72,"column":0},"end":{"line":72,"column":58}},"72":{"start":{"line":73,"column":0},"end":{"line":73,"column":49}},"73":{"start":{"line":74,"column":0},"end":{"line":74,"column":54}},"74":{"start":{"line":75,"column":0},"end":{"line":75,"column":26}},"75":{"start":{"line":76,"column":0},"end":{"line":76,"column":3}},"84":{"start":{"line":85,"column":0},"end":{"line":85,"column":62}},"85":{"start":{"line":86,"column":0},"end":{"line":86,"column":92}},"86":{"start":{"line":87,"column":0},"end":{"line":87,"column":42}},"87":{"start":{"line":88,"column":0},"end":{"line":88,"column":70}},"88":{"start":{"line":89,"column":0},"end":{"line":89,"column":8}},"89":{"start":{"line":90,"column":0},"end":{"line":90,"column":5}},"90":{"start":{"line":91,"column":0},"end":{"line":91,"column":19}},"91":{"start":{"line":92,"column":0},"end":{"line":92,"column":3}},"97":{"start":{"line":98,"column":0},"end":{"line":98,"column":33}},"98":{"start":{"line":99,"column":0},"end":{"line":99,"column":39}},"99":{"start":{"line":100,"column":0},"end":{"line":100,"column":21}},"100":{"start":{"line":101,"column":0},"end":{"line":101,"column":24}},"101":{"start":{"line":102,"column":0},"end":{"line":102,"column":18}},"102":{"start":{"line":103,"column":0},"end":{"line":103,"column":6}},"103":{"start":{"line":104,"column":0},"end":{"line":104,"column":3}},"110":{"start":{"line":111,"column":0},"end":{"line":111,"column":67}},"111":{"start":{"line":112,"column":0},"end":{"line":112,"column":41}},"112":{"start":{"line":113,"column":0},"end":{"line":113,"column":3}},"120":{"start":{"line":121,"column":0},"end":{"line":121,"column":20}},"121":{"start":{"line":122,"column":0},"end":{"line":122,"column":38}},"122":{"start":{"line":123,"column":0},"end":{"line":123,"column":43}},"123":{"start":{"line":124,"column":0},"end":{"line":124,"column":13}},"124":{"start":{"line":125,"column":0},"end":{"line":125,"column":34}},"125":{"start":{"line":126,"column":0},"end":{"line":126,"column":76}},"126":{"start":{"line":127,"column":0},"end":{"line":127,"column":3}},"135":{"start":{"line":136,"column":0},"end":{"line":136,"column":21}},"136":{"start":{"line":137,"column":0},"end":{"line":137,"column":20}},"137":{"start":{"line":138,"column":0},"end":{"line":138,"column":38}},"138":{"start":{"line":139,"column":0},"end":{"line":139,"column":43}},"139":{"start":{"line":140,"column":0},"end":{"line":140,"column":13}},"140":{"start":{"line":141,"column":0},"end":{"line":141,"column":34}},"141":{"start":{"line":142,"column":0},"end":{"line":142,"column":63}},"142":{"start":{"line":143,"column":0},"end":{"line":143,"column":35}},"143":{"start":{"line":144,"column":0},"end":{"line":144,"column":18}},"144":{"start":{"line":145,"column":0},"end":{"line":145,"column":16}},"145":{"start":{"line":146,"column":0},"end":{"line":146,"column":26}},"146":{"start":{"line":147,"column":0},"end":{"line":147,"column":15}},"147":{"start":{"line":148,"column":0},"end":{"line":148,"column":7}},"148":{"start":{"line":149,"column":0},"end":{"line":149,"column":10}},"149":{"start":{"line":150,"column":0},"end":{"line":150,"column":3}},"158":{"start":{"line":159,"column":0},"end":{"line":159,"column":15}},"159":{"start":{"line":160,"column":0},"end":{"line":160,"column":20}},"160":{"start":{"line":161,"column":0},"end":{"line":161,"column":38}},"161":{"start":{"line":162,"column":0},"end":{"line":162,"column":43}},"162":{"start":{"line":163,"column":0},"end":{"line":163,"column":13}},"163":{"start":{"line":164,"column":0},"end":{"line":164,"column":34}},"164":{"start":{"line":165,"column":0},"end":{"line":165,"column":70}},"165":{"start":{"line":166,"column":0},"end":{"line":166,"column":35}},"166":{"start":{"line":167,"column":0},"end":{"line":167,"column":76}},"167":{"start":{"line":168,"column":0},"end":{"line":168,"column":29}},"168":{"start":{"line":169,"column":0},"end":{"line":169,"column":18}},"169":{"start":{"line":170,"column":0},"end":{"line":170,"column":16}},"170":{"start":{"line":171,"column":0},"end":{"line":171,"column":26}},"171":{"start":{"line":172,"column":0},"end":{"line":172,"column":26}},"172":{"start":{"line":173,"column":0},"end":{"line":173,"column":9}},"173":{"start":{"line":174,"column":0},"end":{"line":174,"column":26}},"174":{"start":{"line":175,"column":0},"end":{"line":175,"column":71}},"175":{"start":{"line":176,"column":0},"end":{"line":176,"column":8}},"176":{"start":{"line":177,"column":0},"end":{"line":177,"column":3}},"177":{"start":{"line":178,"column":0},"end":{"line":178,"column":1}}},"s":{"12":1,"13":1,"32":1,"55":1,"56":9,"57":9,"58":9,"59":9,"60":9,"61":9,"62":9,"63":9,"64":9,"65":9,"66":9,"67":9,"68":9,"69":9,"70":9,"71":9,"72":9,"73":9,"74":9,"75":9,"84":1,"85":96,"86":10,"87":10,"88":10,"89":10,"90":86,"91":96,"97":1,"98":9,"99":9,"100":9,"101":9,"102":9,"103":9,"110":1,"111":546,"112":546,"120":1,"121":39,"122":39,"123":39,"124":39,"125":39,"126":39,"135":1,"136":25,"137":25,"138":25,"139":25,"140":25,"141":25,"142":21,"143":21,"144":21,"145":21,"146":21,"147":21,"148":2,"149":25,"158":1,"159":11,"160":11,"161":11,"162":11,"163":11,"164":11,"165":11,"166":8,"167":1,"168":1,"169":1,"170":1,"171":1,"172":1,"173":1,"174":1,"175":1,"176":11,"177":1},"branchMap":{"0":{"type":"branch","line":56,"loc":{"start":{"line":56,"column":2},"end":{"line":76,"column":3}},"locations":[{"start":{"line":56,"column":2},"end":{"line":76,"column":3}}]},"1":{"type":"branch","line":74,"loc":{"start":{"line":74,"column":26},"end":{"line":74,"column":54}},"locations":[{"start":{"line":74,"column":26},"end":{"line":74,"column":54}}]},"2":{"type":"branch","line":75,"loc":{"start":{"line":75,"column":16},"end":{"line":75,"column":26}},"locations":[{"start":{"line":75,"column":16},"end":{"line":75,"column":26}}]},"3":{"type":"branch","line":85,"loc":{"start":{"line":85,"column":2},"end":{"line":92,"column":3}},"locations":[{"start":{"line":85,"column":2},"end":{"line":92,"column":3}}]},"4":{"type":"branch","line":86,"loc":{"start":{"line":86,"column":91},"end":{"line":90,"column":5}},"locations":[{"start":{"line":86,"column":91},"end":{"line":90,"column":5}}]},"5":{"type":"branch","line":90,"loc":{"start":{"line":90,"column":4},"end":{"line":91,"column":19}},"locations":[{"start":{"line":90,"column":4},"end":{"line":91,"column":19}}]},"6":{"type":"branch","line":98,"loc":{"start":{"line":98,"column":2},"end":{"line":104,"column":3}},"locations":[{"start":{"line":98,"column":2},"end":{"line":104,"column":3}}]},"7":{"type":"branch","line":111,"loc":{"start":{"line":111,"column":2},"end":{"line":113,"column":3}},"locations":[{"start":{"line":111,"column":2},"end":{"line":113,"column":3}}]},"8":{"type":"branch","line":121,"loc":{"start":{"line":121,"column":2},"end":{"line":127,"column":3}},"locations":[{"start":{"line":121,"column":2},"end":{"line":127,"column":3}}]},"9":{"type":"branch","line":136,"loc":{"start":{"line":136,"column":2},"end":{"line":150,"column":3}},"locations":[{"start":{"line":136,"column":2},"end":{"line":150,"column":3}}]},"10":{"type":"branch","line":142,"loc":{"start":{"line":142,"column":62},"end":{"line":148,"column":7}},"locations":[{"start":{"line":142,"column":62},"end":{"line":148,"column":7}}]},"11":{"type":"branch","line":148,"loc":{"start":{"line":148,"column":6},"end":{"line":149,"column":10}},"locations":[{"start":{"line":148,"column":6},"end":{"line":149,"column":10}}]},"12":{"type":"branch","line":159,"loc":{"start":{"line":159,"column":2},"end":{"line":177,"column":3}},"locations":[{"start":{"line":159,"column":2},"end":{"line":177,"column":3}}]},"13":{"type":"branch","line":166,"loc":{"start":{"line":166,"column":21},"end":{"line":167,"column":76}},"locations":[{"start":{"line":166,"column":21},"end":{"line":167,"column":76}}]},"14":{"type":"branch","line":167,"loc":{"start":{"line":167,"column":75},"end":{"line":176,"column":8}},"locations":[{"start":{"line":167,"column":75},"end":{"line":176,"column":8}}]}},"b":{"0":[9],"1":[7],"2":[7],"3":[96],"4":[10],"5":[86],"6":[9],"7":[546],"8":[39],"9":[25],"10":[21],"11":[2],"12":[11],"13":[8],"14":[1]},"fnMap":{"0":{"name":"Loan","decl":{"start":{"line":56,"column":2},"end":{"line":76,"column":3}},"loc":{"start":{"line":56,"column":2},"end":{"line":76,"column":3}},"line":56},"1":{"name":"validatePayment","decl":{"start":{"line":85,"column":2},"end":{"line":92,"column":3}},"loc":{"start":{"line":85,"column":2},"end":{"line":92,"column":3}},"line":85},"2":{"name":"calculateMinPayment","decl":{"start":{"line":98,"column":2},"end":{"line":104,"column":3}},"loc":{"start":{"line":98,"column":2},"end":{"line":104,"column":3}},"line":98},"3":{"name":"accrueInterest","decl":{"start":{"line":111,"column":2},"end":{"line":113,"column":3}},"loc":{"start":{"line":111,"column":2},"end":{"line":113,"column":3}},"line":111},"4":{"name":"numPaymentsToZero","decl":{"start":{"line":121,"column":2},"end":{"line":127,"column":3}},"loc":{"start":{"line":121,"column":2},"end":{"line":127,"column":3}},"line":121},"5":{"name":"principalRemaining","decl":{"start":{"line":136,"column":2},"end":{"line":150,"column":3}},"loc":{"start":{"line":136,"column":2},"end":{"line":150,"column":3}},"line":136},"6":{"name":"interestPaid","decl":{"start":{"line":159,"column":2},"end":{"line":177,"column":3}},"loc":{"start":{"line":159,"column":2},"end":{"line":177,"column":3}},"line":159}},"f":{"0":9,"1":96,"2":9,"3":546,"4":39,"5":25,"6":11}}
|
|
6
6
|
,"/home/runner/work/moneyfunx/moneyfunx/src/lib/paymentTypes.ts": {"path":"/home/runner/work/moneyfunx/moneyfunx/src/lib/paymentTypes.ts","all":false,"statementMap":{},"s":{},"branchMap":{},"b":{},"fnMap":{},"f":{}}
|
|
7
7
|
,"/home/runner/work/moneyfunx/moneyfunx/src/lib/payments.ts": {"path":"/home/runner/work/moneyfunx/moneyfunx/src/lib/payments.ts","all":false,"statementMap":{"6":{"start":{"line":7,"column":0},"end":{"line":7,"column":35}},"7":{"start":{"line":8,"column":0},"end":{"line":8,"column":45}},"24":{"start":{"line":25,"column":0},"end":{"line":25,"column":38}},"25":{"start":{"line":26,"column":0},"end":{"line":26,"column":17}},"26":{"start":{"line":27,"column":0},"end":{"line":27,"column":17}},"27":{"start":{"line":28,"column":0},"end":{"line":28,"column":11}},"28":{"start":{"line":29,"column":0},"end":{"line":29,"column":39}},"29":{"start":{"line":30,"column":0},"end":{"line":30,"column":77}},"30":{"start":{"line":31,"column":0},"end":{"line":31,"column":5}},"31":{"start":{"line":32,"column":0},"end":{"line":32,"column":4}},"33":{"start":{"line":34,"column":0},"end":{"line":34,"column":90}},"34":{"start":{"line":35,"column":0},"end":{"line":35,"column":40}},"35":{"start":{"line":36,"column":0},"end":{"line":36,"column":76}},"36":{"start":{"line":37,"column":0},"end":{"line":37,"column":6}},"37":{"start":{"line":38,"column":0},"end":{"line":38,"column":3}},"38":{"start":{"line":39,"column":0},"end":{"line":39,"column":35}},"39":{"start":{"line":40,"column":0},"end":{"line":40,"column":1}},"53":{"start":{"line":54,"column":0},"end":{"line":54,"column":33}},"54":{"start":{"line":55,"column":0},"end":{"line":55,"column":13}},"55":{"start":{"line":56,"column":0},"end":{"line":56,"column":20}},"56":{"start":{"line":57,"column":0},"end":{"line":57,"column":18}},"57":{"start":{"line":58,"column":0},"end":{"line":58,"column":22}},"58":{"start":{"line":59,"column":0},"end":{"line":59,"column":26}},"59":{"start":{"line":60,"column":0},"end":{"line":60,"column":23}},"60":{"start":{"line":61,"column":0},"end":{"line":61,"column":25}},"61":{"start":{"line":62,"column":0},"end":{"line":62,"column":25}},"62":{"start":{"line":63,"column":0},"end":{"line":63,"column":30}},"63":{"start":{"line":64,"column":0},"end":{"line":64,"column":3}},"64":{"start":{"line":65,"column":0},"end":{"line":65,"column":42}},"66":{"start":{"line":67,"column":0},"end":{"line":67,"column":29}},"67":{"start":{"line":68,"column":0},"end":{"line":68,"column":50}},"68":{"start":{"line":69,"column":0},"end":{"line":69,"column":3}},"70":{"start":{"line":71,"column":0},"end":{"line":71,"column":37}},"72":{"start":{"line":73,"column":0},"end":{"line":73,"column":56}},"73":{"start":{"line":74,"column":0},"end":{"line":74,"column":56}},"74":{"start":{"line":75,"column":0},"end":{"line":75,"column":71}},"75":{"start":{"line":76,"column":0},"end":{"line":76,"column":41}},"76":{"start":{"line":77,"column":0},"end":{"line":77,"column":33}},"77":{"start":{"line":78,"column":0},"end":{"line":78,"column":29}},"78":{"start":{"line":79,"column":0},"end":{"line":79,"column":40}},"79":{"start":{"line":80,"column":0},"end":{"line":80,"column":24}},"80":{"start":{"line":81,"column":0},"end":{"line":81,"column":6}},"81":{"start":{"line":82,"column":0},"end":{"line":82,"column":46}},"82":{"start":{"line":83,"column":0},"end":{"line":83,"column":31}},"83":{"start":{"line":84,"column":0},"end":{"line":84,"column":39}},"84":{"start":{"line":85,"column":0},"end":{"line":85,"column":37}},"85":{"start":{"line":86,"column":0},"end":{"line":86,"column":35}},"86":{"start":{"line":87,"column":0},"end":{"line":87,"column":25}},"87":{"start":{"line":88,"column":0},"end":{"line":88,"column":7}},"88":{"start":{"line":89,"column":0},"end":{"line":89,"column":3}},"89":{"start":{"line":90,"column":0},"end":{"line":90,"column":30}},"90":{"start":{"line":91,"column":0},"end":{"line":91,"column":1}},"102":{"start":{"line":103,"column":0},"end":{"line":103,"column":25}},"103":{"start":{"line":104,"column":0},"end":{"line":104,"column":16}},"104":{"start":{"line":105,"column":0},"end":{"line":105,"column":18}},"105":{"start":{"line":106,"column":0},"end":{"line":106,"column":32}},"106":{"start":{"line":107,"column":0},"end":{"line":107,"column":25}},"107":{"start":{"line":108,"column":0},"end":{"line":108,"column":31}},"108":{"start":{"line":109,"column":0},"end":{"line":109,"column":47}},"109":{"start":{"line":110,"column":0},"end":{"line":110,"column":53}},"110":{"start":{"line":111,"column":0},"end":{"line":111,"column":27}},"111":{"start":{"line":112,"column":0},"end":{"line":112,"column":28}},"112":{"start":{"line":113,"column":0},"end":{"line":113,"column":26}},"113":{"start":{"line":114,"column":0},"end":{"line":114,"column":45}},"114":{"start":{"line":115,"column":0},"end":{"line":115,"column":30}},"115":{"start":{"line":116,"column":0},"end":{"line":116,"column":6}},"116":{"start":{"line":117,"column":0},"end":{"line":117,"column":59}},"117":{"start":{"line":118,"column":0},"end":{"line":118,"column":5}},"119":{"start":{"line":120,"column":0},"end":{"line":120,"column":25}},"120":{"start":{"line":121,"column":0},"end":{"line":121,"column":20}},"121":{"start":{"line":122,"column":0},"end":{"line":122,"column":32}},"122":{"start":{"line":123,"column":0},"end":{"line":123,"column":33}},"123":{"start":{"line":124,"column":0},"end":{"line":124,"column":59}},"125":{"start":{"line":126,"column":0},"end":{"line":126,"column":36}},"126":{"start":{"line":127,"column":0},"end":{"line":127,"column":48}},"127":{"start":{"line":128,"column":0},"end":{"line":128,"column":28}},"128":{"start":{"line":129,"column":0},"end":{"line":129,"column":28}},"129":{"start":{"line":130,"column":0},"end":{"line":130,"column":68}},"130":{"start":{"line":131,"column":0},"end":{"line":131,"column":78}},"131":{"start":{"line":132,"column":0},"end":{"line":132,"column":51}},"132":{"start":{"line":133,"column":0},"end":{"line":133,"column":34}},"133":{"start":{"line":134,"column":0},"end":{"line":134,"column":23}},"134":{"start":{"line":135,"column":0},"end":{"line":135,"column":28}},"135":{"start":{"line":136,"column":0},"end":{"line":136,"column":6}},"136":{"start":{"line":137,"column":0},"end":{"line":137,"column":50}},"137":{"start":{"line":138,"column":0},"end":{"line":138,"column":16}},"138":{"start":{"line":139,"column":0},"end":{"line":139,"column":34}},"139":{"start":{"line":140,"column":0},"end":{"line":140,"column":23}},"140":{"start":{"line":141,"column":0},"end":{"line":141,"column":19}},"141":{"start":{"line":142,"column":0},"end":{"line":142,"column":20}},"142":{"start":{"line":143,"column":0},"end":{"line":143,"column":6}},"143":{"start":{"line":144,"column":0},"end":{"line":144,"column":51}},"144":{"start":{"line":145,"column":0},"end":{"line":145,"column":35}},"145":{"start":{"line":146,"column":0},"end":{"line":146,"column":25}},"146":{"start":{"line":147,"column":0},"end":{"line":147,"column":25}},"147":{"start":{"line":148,"column":0},"end":{"line":148,"column":35}},"148":{"start":{"line":149,"column":0},"end":{"line":149,"column":35}},"149":{"start":{"line":150,"column":0},"end":{"line":150,"column":37}},"150":{"start":{"line":151,"column":0},"end":{"line":151,"column":27}},"151":{"start":{"line":152,"column":0},"end":{"line":152,"column":27}},"152":{"start":{"line":153,"column":0},"end":{"line":153,"column":37}},"153":{"start":{"line":154,"column":0},"end":{"line":154,"column":9}},"154":{"start":{"line":155,"column":0},"end":{"line":155,"column":7}},"156":{"start":{"line":157,"column":0},"end":{"line":157,"column":54}},"157":{"start":{"line":158,"column":0},"end":{"line":158,"column":56}},"158":{"start":{"line":159,"column":0},"end":{"line":159,"column":29}},"159":{"start":{"line":160,"column":0},"end":{"line":160,"column":6}},"160":{"start":{"line":161,"column":0},"end":{"line":161,"column":33}},"161":{"start":{"line":162,"column":0},"end":{"line":162,"column":35}},"162":{"start":{"line":163,"column":0},"end":{"line":163,"column":29}},"163":{"start":{"line":164,"column":0},"end":{"line":164,"column":6}},"164":{"start":{"line":165,"column":0},"end":{"line":165,"column":19}},"166":{"start":{"line":167,"column":0},"end":{"line":167,"column":53}},"167":{"start":{"line":168,"column":0},"end":{"line":168,"column":70}},"168":{"start":{"line":169,"column":0},"end":{"line":169,"column":43}},"169":{"start":{"line":170,"column":0},"end":{"line":170,"column":13}},"170":{"start":{"line":171,"column":0},"end":{"line":171,"column":31}},"171":{"start":{"line":172,"column":0},"end":{"line":172,"column":24}},"172":{"start":{"line":173,"column":0},"end":{"line":173,"column":17}},"173":{"start":{"line":174,"column":0},"end":{"line":174,"column":23}},"174":{"start":{"line":175,"column":0},"end":{"line":175,"column":36}},"175":{"start":{"line":176,"column":0},"end":{"line":176,"column":35}},"176":{"start":{"line":177,"column":0},"end":{"line":177,"column":28}},"177":{"start":{"line":178,"column":0},"end":{"line":178,"column":29}},"178":{"start":{"line":179,"column":0},"end":{"line":179,"column":12}},"179":{"start":{"line":180,"column":0},"end":{"line":180,"column":10}},"180":{"start":{"line":181,"column":0},"end":{"line":181,"column":23}},"181":{"start":{"line":182,"column":0},"end":{"line":182,"column":64}},"182":{"start":{"line":183,"column":0},"end":{"line":183,"column":8}},"183":{"start":{"line":184,"column":0},"end":{"line":184,"column":51}},"184":{"start":{"line":185,"column":0},"end":{"line":185,"column":53}},"185":{"start":{"line":186,"column":0},"end":{"line":186,"column":23}},"186":{"start":{"line":187,"column":0},"end":{"line":187,"column":8}},"188":{"start":{"line":189,"column":0},"end":{"line":189,"column":53}},"189":{"start":{"line":190,"column":0},"end":{"line":190,"column":15}},"190":{"start":{"line":191,"column":0},"end":{"line":191,"column":29}},"191":{"start":{"line":192,"column":0},"end":{"line":192,"column":60}},"192":{"start":{"line":193,"column":0},"end":{"line":193,"column":27}},"194":{"start":{"line":195,"column":0},"end":{"line":195,"column":78}},"195":{"start":{"line":196,"column":0},"end":{"line":196,"column":53}},"196":{"start":{"line":197,"column":0},"end":{"line":197,"column":66}},"197":{"start":{"line":198,"column":0},"end":{"line":198,"column":10}},"198":{"start":{"line":199,"column":0},"end":{"line":199,"column":44}},"199":{"start":{"line":200,"column":0},"end":{"line":200,"column":13}},"200":{"start":{"line":201,"column":0},"end":{"line":201,"column":35}},"201":{"start":{"line":202,"column":0},"end":{"line":202,"column":73}},"202":{"start":{"line":203,"column":0},"end":{"line":203,"column":70}},"203":{"start":{"line":204,"column":0},"end":{"line":204,"column":31}},"204":{"start":{"line":205,"column":0},"end":{"line":205,"column":42}},"205":{"start":{"line":206,"column":0},"end":{"line":206,"column":52}},"206":{"start":{"line":207,"column":0},"end":{"line":207,"column":11}},"207":{"start":{"line":208,"column":0},"end":{"line":208,"column":20}},"208":{"start":{"line":209,"column":0},"end":{"line":209,"column":9}},"209":{"start":{"line":210,"column":0},"end":{"line":210,"column":7}},"211":{"start":{"line":212,"column":0},"end":{"line":212,"column":24}},"212":{"start":{"line":213,"column":0},"end":{"line":213,"column":45}},"213":{"start":{"line":214,"column":0},"end":{"line":214,"column":5}},"214":{"start":{"line":215,"column":0},"end":{"line":215,"column":35}},"215":{"start":{"line":216,"column":0},"end":{"line":216,"column":3}},"217":{"start":{"line":218,"column":0},"end":{"line":218,"column":29}},"218":{"start":{"line":219,"column":0},"end":{"line":219,"column":34}},"219":{"start":{"line":220,"column":0},"end":{"line":220,"column":55}},"220":{"start":{"line":221,"column":0},"end":{"line":221,"column":73}},"221":{"start":{"line":222,"column":0},"end":{"line":222,"column":9}},"222":{"start":{"line":223,"column":0},"end":{"line":223,"column":7}},"224":{"start":{"line":225,"column":0},"end":{"line":225,"column":65}},"225":{"start":{"line":226,"column":0},"end":{"line":226,"column":60}},"226":{"start":{"line":227,"column":0},"end":{"line":227,"column":50}},"227":{"start":{"line":228,"column":0},"end":{"line":228,"column":45}},"228":{"start":{"line":229,"column":0},"end":{"line":229,"column":3}},"230":{"start":{"line":231,"column":0},"end":{"line":231,"column":24}},"231":{"start":{"line":232,"column":0},"end":{"line":232,"column":44}},"232":{"start":{"line":233,"column":0},"end":{"line":233,"column":46}},"233":{"start":{"line":234,"column":0},"end":{"line":234,"column":51}},"234":{"start":{"line":235,"column":0},"end":{"line":235,"column":4}},"236":{"start":{"line":237,"column":0},"end":{"line":237,"column":21}},"237":{"start":{"line":238,"column":0},"end":{"line":238,"column":1}}},"s":{"6":1,"7":1,"24":1,"25":8,"26":8,"27":8,"28":8,"29":8,"30":8,"31":8,"33":8,"34":1,"35":1,"36":1,"37":1,"38":7,"39":7,"53":1,"54":13,"55":13,"56":13,"57":13,"58":13,"59":13,"60":13,"61":13,"62":1,"63":1,"64":13,"66":13,"67":1,"68":1,"70":13,"72":13,"73":13,"74":539,"75":539,"76":539,"77":13,"78":539,"79":539,"80":539,"81":539,"82":539,"83":539,"84":539,"85":539,"86":539,"87":539,"88":539,"89":13,"90":13,"102":1,"103":2,"104":2,"105":2,"106":2,"107":2,"108":2,"109":2,"110":2,"111":6,"112":6,"113":6,"114":6,"115":6,"116":6,"117":2,"119":2,"120":2,"121":2,"122":2,"123":2,"125":2,"126":6,"127":6,"128":6,"129":6,"130":6,"131":6,"132":6,"133":6,"134":6,"135":6,"136":6,"137":6,"138":6,"139":6,"140":6,"141":6,"142":6,"143":6,"144":6,"145":6,"146":6,"147":6,"148":6,"149":6,"150":6,"151":6,"152":6,"153":6,"154":6,"156":6,"157":6,"158":6,"159":6,"160":6,"161":6,"162":6,"163":6,"164":6,"166":6,"167":6,"168":6,"169":6,"170":6,"171":6,"172":6,"173":6,"174":6,"175":6,"176":6,"177":6,"178":6,"179":6,"180":6,"181":6,"182":6,"183":6,"184":6,"185":6,"186":6,"188":6,"189":6,"190":6,"191":6,"192":6,"194":6,"195":145,"196":145,"197":145,"198":145,"199":99,"200":99,"201":99,"202":99,"203":99,"204":99,"205":99,"206":99,"207":46,"208":6,"209":6,"211":6,"212":3,"213":3,"214":6,"215":6,"217":2,"218":6,"219":6,"220":6,"221":6,"222":6,"224":6,"225":6,"226":6,"227":6,"228":6,"230":2,"231":2,"232":2,"233":2,"234":2,"236":2,"237":2},"branchMap":{"0":{"type":"branch","line":25,"loc":{"start":{"line":25,"column":7},"end":{"line":40,"column":1}},"locations":[{"start":{"line":25,"column":7},"end":{"line":40,"column":1}}]},"1":{"type":"branch","line":34,"loc":{"start":{"line":34,"column":89},"end":{"line":38,"column":3}},"locations":[{"start":{"line":34,"column":89},"end":{"line":38,"column":3}}]},"2":{"type":"branch","line":38,"loc":{"start":{"line":38,"column":2},"end":{"line":40,"column":1}},"locations":[{"start":{"line":38,"column":2},"end":{"line":40,"column":1}}]},"3":{"type":"branch","line":30,"loc":{"start":{"line":30,"column":4},"end":{"line":30,"column":77}},"locations":[{"start":{"line":30,"column":4},"end":{"line":30,"column":77}}]},"4":{"type":"branch","line":54,"loc":{"start":{"line":54,"column":7},"end":{"line":91,"column":1}},"locations":[{"start":{"line":54,"column":7},"end":{"line":91,"column":1}}]},"5":{"type":"branch","line":62,"loc":{"start":{"line":62,"column":24},"end":{"line":64,"column":3}},"locations":[{"start":{"line":62,"column":24},"end":{"line":64,"column":3}}]},"6":{"type":"branch","line":67,"loc":{"start":{"line":67,"column":28},"end":{"line":69,"column":3}},"locations":[{"start":{"line":67,"column":28},"end":{"line":69,"column":3}}]},"7":{"type":"branch","line":74,"loc":{"start":{"line":74,"column":55},"end":{"line":89,"column":3}},"locations":[{"start":{"line":74,"column":55},"end":{"line":89,"column":3}}]},"8":{"type":"branch","line":77,"loc":{"start":{"line":77,"column":32},"end":{"line":78,"column":29}},"locations":[{"start":{"line":77,"column":32},"end":{"line":78,"column":29}}]},"9":{"type":"branch","line":78,"loc":{"start":{"line":78,"column":20},"end":{"line":79,"column":21}},"locations":[{"start":{"line":78,"column":20},"end":{"line":79,"column":21}}]},"10":{"type":"branch","line":103,"loc":{"start":{"line":103,"column":7},"end":{"line":238,"column":1}},"locations":[{"start":{"line":103,"column":7},"end":{"line":238,"column":1}}]},"11":{"type":"branch","line":126,"loc":{"start":{"line":126,"column":35},"end":{"line":216,"column":3}},"locations":[{"start":{"line":126,"column":35},"end":{"line":216,"column":3}}]},"12":{"type":"branch","line":212,"loc":{"start":{"line":212,"column":23},"end":{"line":214,"column":5}},"locations":[{"start":{"line":212,"column":23},"end":{"line":214,"column":5}}]},"13":{"type":"branch","line":218,"loc":{"start":{"line":218,"column":28},"end":{"line":229,"column":3}},"locations":[{"start":{"line":218,"column":28},"end":{"line":229,"column":3}}]},"14":{"type":"branch","line":111,"loc":{"start":{"line":111,"column":16},"end":{"line":118,"column":3}},"locations":[{"start":{"line":111,"column":16},"end":{"line":118,"column":3}}]},"15":{"type":"branch","line":167,"loc":{"start":{"line":167,"column":35},"end":{"line":210,"column":5}},"locations":[{"start":{"line":167,"column":35},"end":{"line":210,"column":5}}]},"16":{"type":"branch","line":182,"loc":{"start":{"line":182,"column":19},"end":{"line":182,"column":42}},"locations":[{"start":{"line":182,"column":19},"end":{"line":182,"column":42}}]},"17":{"type":"branch","line":182,"loc":{"start":{"line":182,"column":25},"end":{"line":182,"column":63}},"locations":[{"start":{"line":182,"column":25},"end":{"line":182,"column":63}}]},"18":{"type":"branch","line":182,"loc":{"start":{"line":182,"column":42},"end":{"line":182,"column":64}},"locations":[{"start":{"line":182,"column":42},"end":{"line":182,"column":64}}]},"19":{"type":"branch","line":195,"loc":{"start":{"line":195,"column":64},"end":{"line":209,"column":7}},"locations":[{"start":{"line":195,"column":64},"end":{"line":209,"column":7}}]},"20":{"type":"branch","line":199,"loc":{"start":{"line":199,"column":39},"end":{"line":207,"column":11}},"locations":[{"start":{"line":199,"column":39},"end":{"line":207,"column":11}}]},"21":{"type":"branch","line":207,"loc":{"start":{"line":207,"column":10},"end":{"line":208,"column":20}},"locations":[{"start":{"line":207,"column":10},"end":{"line":208,"column":20}}]},"22":{"type":"branch","line":197,"loc":{"start":{"line":197,"column":10},"end":{"line":197,"column":66}},"locations":[{"start":{"line":197,"column":10},"end":{"line":197,"column":66}}]},"23":{"type":"branch","line":221,"loc":{"start":{"line":221,"column":8},"end":{"line":221,"column":73}},"locations":[{"start":{"line":221,"column":8},"end":{"line":221,"column":73}}]}},"b":{"0":[8],"1":[1],"2":[7],"3":[18],"4":[13],"5":[1],"6":[1],"7":[539],"8":[13],"9":[526],"10":[2],"11":[6],"12":[3],"13":[6],"14":[6],"15":[6],"16":[4],"17":[2],"18":[4],"19":[145],"20":[99],"21":[46],"22":[1283],"23":[358]},"fnMap":{"0":{"name":"determineExtraPayment","decl":{"start":{"line":25,"column":7},"end":{"line":40,"column":1}},"loc":{"start":{"line":25,"column":7},"end":{"line":40,"column":1}},"line":25},"1":{"name":"amortizePayments","decl":{"start":{"line":54,"column":7},"end":{"line":91,"column":1}},"loc":{"start":{"line":54,"column":7},"end":{"line":91,"column":1}},"line":54},"2":{"name":"payLoans","decl":{"start":{"line":103,"column":7},"end":{"line":238,"column":1}},"loc":{"start":{"line":103,"column":7},"end":{"line":238,"column":1}},"line":103}},"f":{"0":8,"1":13,"2":2}}
|
|
8
|
-
,"/home/runner/work/moneyfunx/moneyfunx/src/lib/sorting.ts": {"path":"/home/runner/work/moneyfunx/moneyfunx/src/lib/sorting.ts","all":false,"statementMap":{"18":{"start":{"line":19,"column":0},"end":{"line":19,"column":
|
|
8
|
+
,"/home/runner/work/moneyfunx/moneyfunx/src/lib/sorting.ts": {"path":"/home/runner/work/moneyfunx/moneyfunx/src/lib/sorting.ts","all":false,"statementMap":{"18":{"start":{"line":19,"column":0},"end":{"line":19,"column":63}},"19":{"start":{"line":20,"column":0},"end":{"line":20,"column":45}},"20":{"start":{"line":21,"column":0},"end":{"line":21,"column":1}},"28":{"start":{"line":29,"column":0},"end":{"line":29,"column":62}},"29":{"start":{"line":30,"column":0},"end":{"line":30,"column":53}},"30":{"start":{"line":31,"column":0},"end":{"line":31,"column":1}},"38":{"start":{"line":39,"column":0},"end":{"line":39,"column":80}},"39":{"start":{"line":40,"column":0},"end":{"line":40,"column":34}},"40":{"start":{"line":41,"column":0},"end":{"line":41,"column":1}}},"s":{"18":1,"19":8,"20":8,"28":1,"29":5,"30":5,"38":1,"39":3,"40":3},"branchMap":{"0":{"type":"branch","line":19,"loc":{"start":{"line":19,"column":7},"end":{"line":21,"column":1}},"locations":[{"start":{"line":19,"column":7},"end":{"line":21,"column":1}}]},"1":{"type":"branch","line":29,"loc":{"start":{"line":29,"column":7},"end":{"line":31,"column":1}},"locations":[{"start":{"line":29,"column":7},"end":{"line":31,"column":1}}]},"2":{"type":"branch","line":39,"loc":{"start":{"line":39,"column":7},"end":{"line":41,"column":1}},"locations":[{"start":{"line":39,"column":7},"end":{"line":41,"column":1}}]}},"b":{"0":[8],"1":[5],"2":[3]},"fnMap":{"0":{"name":"avalanche","decl":{"start":{"line":19,"column":7},"end":{"line":21,"column":1}},"loc":{"start":{"line":19,"column":7},"end":{"line":21,"column":1}},"line":19},"1":{"name":"snowball","decl":{"start":{"line":29,"column":7},"end":{"line":31,"column":1}},"loc":{"start":{"line":29,"column":7},"end":{"line":31,"column":1}},"line":29},"2":{"name":"sortLoans","decl":{"start":{"line":39,"column":7},"end":{"line":41,"column":1}},"loc":{"start":{"line":39,"column":7},"end":{"line":41,"column":1}},"line":39}},"f":{"0":8,"1":5,"2":3}}
|
|
9
9
|
}
|
package/coverage/index.html
CHANGED
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
117
117
|
Code coverage generated by
|
|
118
118
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
119
|
-
at 2025-02-
|
|
119
|
+
at 2025-02-16T23:10:30.245Z
|
|
120
120
|
</div>
|
|
121
121
|
<script src="prettify.js"></script>
|
|
122
122
|
<script>
|
package/coverage/src/index.html
CHANGED
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
102
102
|
Code coverage generated by
|
|
103
103
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
104
|
-
at 2025-02-
|
|
104
|
+
at 2025-02-16T23:10:30.245Z
|
|
105
105
|
</div>
|
|
106
106
|
<script src="../prettify.js"></script>
|
|
107
107
|
<script>
|
|
@@ -136,7 +136,7 @@ export { snowball, avalanche, sortLoans } from './lib/sorting';
|
|
|
136
136
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
137
137
|
Code coverage generated by
|
|
138
138
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
139
|
-
at 2025-02-
|
|
139
|
+
at 2025-02-16T23:10:30.245Z
|
|
140
140
|
</div>
|
|
141
141
|
<script src="../prettify.js"></script>
|
|
142
142
|
<script>
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
71
71
|
Code coverage generated by
|
|
72
72
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
73
|
-
at 2025-02-
|
|
73
|
+
at 2025-02-16T23:10:30.245Z
|
|
74
74
|
</div>
|
|
75
75
|
<script src="../../prettify.js"></script>
|
|
76
76
|
<script>
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
92
92
|
Code coverage generated by
|
|
93
93
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
94
|
-
at 2025-02-
|
|
94
|
+
at 2025-02-16T23:10:30.245Z
|
|
95
95
|
</div>
|
|
96
96
|
<script src="../../prettify.js"></script>
|
|
97
97
|
<script>
|
|
@@ -150,17 +150,7 @@
|
|
|
150
150
|
<a name='L85'></a><a href='#L85'>85</a>
|
|
151
151
|
<a name='L86'></a><a href='#L86'>86</a>
|
|
152
152
|
<a name='L87'></a><a href='#L87'>87</a>
|
|
153
|
-
<a name='L88'></a><a href='#L88'>88</a>
|
|
154
|
-
<a name='L89'></a><a href='#L89'>89</a>
|
|
155
|
-
<a name='L90'></a><a href='#L90'>90</a>
|
|
156
|
-
<a name='L91'></a><a href='#L91'>91</a>
|
|
157
|
-
<a name='L92'></a><a href='#L92'>92</a>
|
|
158
|
-
<a name='L93'></a><a href='#L93'>93</a>
|
|
159
|
-
<a name='L94'></a><a href='#L94'>94</a>
|
|
160
|
-
<a name='L95'></a><a href='#L95'>95</a>
|
|
161
|
-
<a name='L96'></a><a href='#L96'>96</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
162
|
-
<span class="cline-any cline-neutral"> </span>
|
|
163
|
-
<span class="cline-any cline-neutral"> </span>
|
|
153
|
+
<a name='L88'></a><a href='#L88'>88</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
164
154
|
<span class="cline-any cline-neutral"> </span>
|
|
165
155
|
<span class="cline-any cline-neutral"> </span>
|
|
166
156
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -195,8 +185,6 @@
|
|
|
195
185
|
<span class="cline-any cline-neutral"> </span>
|
|
196
186
|
<span class="cline-any cline-neutral"> </span>
|
|
197
187
|
<span class="cline-any cline-neutral"> </span>
|
|
198
|
-
<span class="cline-any cline-neutral"> </span>
|
|
199
|
-
<span class="cline-any cline-neutral"> </span>
|
|
200
188
|
<span class="cline-any cline-yes">1x</span>
|
|
201
189
|
<span class="cline-any cline-yes">30x</span>
|
|
202
190
|
<span class="cline-any cline-yes">30x</span>
|
|
@@ -219,8 +207,6 @@
|
|
|
219
207
|
<span class="cline-any cline-neutral"> </span>
|
|
220
208
|
<span class="cline-any cline-neutral"> </span>
|
|
221
209
|
<span class="cline-any cline-neutral"> </span>
|
|
222
|
-
<span class="cline-any cline-neutral"> </span>
|
|
223
|
-
<span class="cline-any cline-neutral"> </span>
|
|
224
210
|
<span class="cline-any cline-yes">1x</span>
|
|
225
211
|
<span class="cline-any cline-yes">9x</span>
|
|
226
212
|
<span class="cline-any cline-yes">9x</span>
|
|
@@ -241,8 +227,6 @@
|
|
|
241
227
|
<span class="cline-any cline-neutral"> </span>
|
|
242
228
|
<span class="cline-any cline-neutral"> </span>
|
|
243
229
|
<span class="cline-any cline-neutral"> </span>
|
|
244
|
-
<span class="cline-any cline-neutral"> </span>
|
|
245
|
-
<span class="cline-any cline-neutral"> </span>
|
|
246
230
|
<span class="cline-any cline-yes">1x</span>
|
|
247
231
|
<span class="cline-any cline-yes">49x</span>
|
|
248
232
|
<span class="cline-any cline-yes">49x</span>
|
|
@@ -262,10 +246,8 @@
|
|
|
262
246
|
/**
|
|
263
247
|
* Calculates the minimum payment to pay the principal back in the number of periods at the periodic rate
|
|
264
248
|
*
|
|
265
|
-
* balance = principal + interest
|
|
266
|
-
*
|
|
267
249
|
* @param {number} principal The amount borrowed
|
|
268
|
-
* @param {number} periodicRate The rate the
|
|
250
|
+
* @param {number} periodicRate The rate the principal accrues interest at per period
|
|
269
251
|
* @param {number [int]} periods The number of periods the principal is repaid over
|
|
270
252
|
* @returns {number} The minimum payment
|
|
271
253
|
*/
|
|
@@ -284,11 +266,9 @@ export function calculateMinPayment(
|
|
|
284
266
|
/**
|
|
285
267
|
* Calculates the principal remaining after a certain number of payments from a beginning principal at a periodic rate
|
|
286
268
|
*
|
|
287
|
-
* balance = principal + interest
|
|
288
|
-
*
|
|
289
269
|
* @param {number} principal The amount borrowed
|
|
290
270
|
* @param {number} payment The amount paid at each period
|
|
291
|
-
* @param {number} periodicRate The rate the
|
|
271
|
+
* @param {number} periodicRate The rate the princpal accrues interest at per period
|
|
292
272
|
* @param {number [int]} periods The number of periods paid to compute the desired principal remaining
|
|
293
273
|
* @returns {number} The remaining principal
|
|
294
274
|
*/
|
|
@@ -299,8 +279,8 @@ export function principalRemaining(
|
|
|
299
279
|
periods: number
|
|
300
280
|
): number {
|
|
301
281
|
return Math.max(
|
|
302
|
-
principal * (1 + periodicRate) ** periods -
|
|
303
|
-
payment * ((
|
|
282
|
+
(principal * (1 + periodicRate) ** periods) -
|
|
283
|
+
(payment * ((1 + periodicRate) ** periods - 1) / periodicRate),
|
|
304
284
|
0
|
|
305
285
|
);
|
|
306
286
|
}
|
|
@@ -308,11 +288,9 @@ export function principalRemaining(
|
|
|
308
288
|
/**
|
|
309
289
|
* Calculates the total interest paid after a certain number of payments from a beginning principal at a periodic rate
|
|
310
290
|
*
|
|
311
|
-
* balance = principal + interest
|
|
312
|
-
*
|
|
313
291
|
* @param {number} principal The amount borrowed
|
|
314
292
|
* @param {number} payment The amount paid at each period
|
|
315
|
-
* @param {number} periodicRate The rate the
|
|
293
|
+
* @param {number} periodicRate The rate the princpal accrues interest at per period
|
|
316
294
|
* @param {number [int]} periods The number of periods paid to compute the desired principal remaining
|
|
317
295
|
* @returns {number} The total interest paid
|
|
318
296
|
*/
|
|
@@ -331,11 +309,9 @@ export function interestPaid(
|
|
|
331
309
|
/**
|
|
332
310
|
* Calculates the number of payments required to pay off a principal
|
|
333
311
|
*
|
|
334
|
-
* balance = principal + interest
|
|
335
|
-
*
|
|
336
312
|
* @param {number} principal The amount borrowed
|
|
337
313
|
* @param {number} payment The amount paid at each period
|
|
338
|
-
* @param {number} periodicRate The rate the
|
|
314
|
+
* @param {number} periodicRate The rate the princpal accrues interest at per period
|
|
339
315
|
* @returns The number of payments needed to pay off the principal
|
|
340
316
|
*/
|
|
341
317
|
export function numPaymentsToZero(
|
|
@@ -355,7 +331,7 @@ export function numPaymentsToZero(
|
|
|
355
331
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
356
332
|
Code coverage generated by
|
|
357
333
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
358
|
-
at 2025-02-
|
|
334
|
+
at 2025-02-16T23:10:30.245Z
|
|
359
335
|
</div>
|
|
360
336
|
<script src="../../prettify.js"></script>
|
|
361
337
|
<script>
|
|
@@ -191,7 +191,7 @@
|
|
|
191
191
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
192
192
|
Code coverage generated by
|
|
193
193
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
194
|
-
at 2025-02-
|
|
194
|
+
at 2025-02-16T23:10:30.245Z
|
|
195
195
|
</div>
|
|
196
196
|
<script src="../../prettify.js"></script>
|
|
197
197
|
<script>
|
|
@@ -604,7 +604,7 @@ export class Loan implements ILoan {
|
|
|
604
604
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
605
605
|
Code coverage generated by
|
|
606
606
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
607
|
-
at 2025-02-
|
|
607
|
+
at 2025-02-16T23:10:30.245Z
|
|
608
608
|
</div>
|
|
609
609
|
<script src="../../prettify.js"></script>
|
|
610
610
|
<script>
|
|
@@ -118,7 +118,7 @@ export type LoanPrincipals = Record<string, number>;
|
|
|
118
118
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
119
119
|
Code coverage generated by
|
|
120
120
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
121
|
-
at 2025-02-
|
|
121
|
+
at 2025-02-16T23:10:30.245Z
|
|
122
122
|
</div>
|
|
123
123
|
<script src="../../prettify.js"></script>
|
|
124
124
|
<script>
|
|
@@ -559,7 +559,7 @@ import type {
|
|
|
559
559
|
* Calculates the extra amount in a payment after all loans' minimum payments are met
|
|
560
560
|
* Throws an exception if the payment provided is less than the collective minimum payments for all loans
|
|
561
561
|
*
|
|
562
|
-
* @param {
|
|
562
|
+
* @param {ILoan[]} loans The loans to allocate minimum payments
|
|
563
563
|
* @param {number} payment The amount to pay across all loans
|
|
564
564
|
* @returns {number} The extra amount of payment
|
|
565
565
|
*/
|
|
@@ -590,7 +590,7 @@ export function determineExtraPayment(
|
|
|
590
590
|
* @param {number} numPayments The number of periods to make payments to the loan
|
|
591
591
|
* @param {number} startPeriod An initial offset of periods to 'fast-forward' the state of the loan to prior to calculation of each period
|
|
592
592
|
* @param {number} carryover An additional amount to pay towards a loan, used when a residual amount is available from paying off the previous loan this period
|
|
593
|
-
* @returns {
|
|
593
|
+
* @returns {AmortizationRecord[]} The amortization schdule for the number of payments of payment made to the loan from the provided start period
|
|
594
594
|
*/
|
|
595
595
|
export function amortizePayments(
|
|
596
596
|
loan: Loan,
|
|
@@ -635,7 +635,7 @@ export function amortizePayments(
|
|
|
635
635
|
*
|
|
636
636
|
* Calculates a wealth of information about paying of a set of loans with a total payment amount
|
|
637
637
|
*
|
|
638
|
-
* @param {
|
|
638
|
+
* @param {Loan[]} loans The loans to pay off
|
|
639
639
|
* @param {number} payment The total amount of money budgeted to pay all loans each period
|
|
640
640
|
* @param {boolean} reduceMinimum Flag to reduce the total payment amount by a loan's minimum when that loan is paid off
|
|
641
641
|
* @returns {LoansPaymentSchedule} Various totals and series of data regarding paying off the loans at the payment amount
|
|
@@ -784,7 +784,7 @@ export function payLoans(
|
|
|
784
784
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
785
785
|
Code coverage generated by
|
|
786
786
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
787
|
-
at 2025-02-
|
|
787
|
+
at 2025-02-16T23:10:30.245Z
|
|
788
788
|
</div>
|
|
789
789
|
<script src="../../prettify.js"></script>
|
|
790
790
|
<script>
|
|
@@ -147,43 +147,43 @@
|
|
|
147
147
|
<span class="cline-any cline-yes">3x</span>
|
|
148
148
|
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">/**
|
|
149
149
|
*
|
|
150
|
-
* This file contains functions for sorting Arrays of
|
|
150
|
+
* This file contains functions for sorting Arrays of ILoans on certain attributes
|
|
151
151
|
*
|
|
152
152
|
*/
|
|
153
153
|
|
|
154
|
-
import {
|
|
154
|
+
import { ILoan } from './loan';
|
|
155
155
|
|
|
156
|
-
type avalanche = (loan1:
|
|
157
|
-
type snowball = (loan1:
|
|
156
|
+
type avalanche = (loan1: ILoan, loan2: ILoan) => number;
|
|
157
|
+
type snowball = (loan1: ILoan, loan2: ILoan) => number;
|
|
158
158
|
type sortFunction = avalanche | snowball;
|
|
159
159
|
|
|
160
160
|
/**
|
|
161
161
|
* Sorts loans descending by interest rate
|
|
162
|
-
* @param {
|
|
163
|
-
* @param {
|
|
162
|
+
* @param {ILoan} loan1 A loan to be comapred
|
|
163
|
+
* @param {ILoan} loan2 A loan to be comapred
|
|
164
164
|
* @returns {number} the order in which to sort the loans in descending interest rate
|
|
165
165
|
*/
|
|
166
|
-
export function avalanche(loan1:
|
|
166
|
+
export function avalanche(loan1: ILoan, loan2: ILoan): number {
|
|
167
167
|
return loan2.annualRate - loan1.annualRate;
|
|
168
168
|
}
|
|
169
169
|
|
|
170
170
|
/**
|
|
171
171
|
* Sorts loans ascending by principal
|
|
172
|
-
* @param {
|
|
173
|
-
* @param {
|
|
172
|
+
* @param {ILoan} loan1 A loan to be compared
|
|
173
|
+
* @param {ILoan} loan2 A loan to be compared
|
|
174
174
|
* @returns {number} the order in which to sort the loans in ascending princpal
|
|
175
175
|
*/
|
|
176
|
-
export function snowball(loan1:
|
|
176
|
+
export function snowball(loan1: ILoan, loan2: ILoan): number {
|
|
177
177
|
return loan1.currentBalance - loan2.currentBalance;
|
|
178
178
|
}
|
|
179
179
|
|
|
180
180
|
/**
|
|
181
181
|
* Sorts an array of loans using the provided sortFunc
|
|
182
|
-
* @param {
|
|
182
|
+
* @param {ILoan[]} loans The loans to sort
|
|
183
183
|
* @param {function} sortFunc The algorithm to sort the loans with
|
|
184
184
|
* @returns The sorted array loans
|
|
185
185
|
*/
|
|
186
|
-
export function sortLoans(loans:
|
|
186
|
+
export function sortLoans(loans: ILoan[], sortFunction: sortFunction): ILoan[] {
|
|
187
187
|
return loans.sort(sortFunction);
|
|
188
188
|
}
|
|
189
189
|
</pre></td></tr></table></pre>
|
|
@@ -193,7 +193,7 @@ export function sortLoans(loans: Loan[], sortFunction: sortFunction): Loan[] {
|
|
|
193
193
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
194
194
|
Code coverage generated by
|
|
195
195
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
196
|
-
at 2025-02-
|
|
196
|
+
at 2025-02-16T23:10:30.245Z
|
|
197
197
|
</div>
|
|
198
198
|
<script src="../../prettify.js"></script>
|
|
199
199
|
<script>
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "moneyfunx",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.2.
|
|
4
|
+
"version": "1.2.4",
|
|
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",
|
|
@@ -7,10 +7,8 @@
|
|
|
7
7
|
/**
|
|
8
8
|
* Calculates the minimum payment to pay the principal back in the number of periods at the periodic rate
|
|
9
9
|
*
|
|
10
|
-
* balance = principal + interest
|
|
11
|
-
*
|
|
12
10
|
* @param {number} principal The amount borrowed
|
|
13
|
-
* @param {number} periodicRate The rate the
|
|
11
|
+
* @param {number} periodicRate The rate the principal accrues interest at per period
|
|
14
12
|
* @param {number [int]} periods The number of periods the principal is repaid over
|
|
15
13
|
* @returns {number} The minimum payment
|
|
16
14
|
*/
|
|
@@ -29,11 +27,9 @@ export function calculateMinPayment(
|
|
|
29
27
|
/**
|
|
30
28
|
* Calculates the principal remaining after a certain number of payments from a beginning principal at a periodic rate
|
|
31
29
|
*
|
|
32
|
-
* balance = principal + interest
|
|
33
|
-
*
|
|
34
30
|
* @param {number} principal The amount borrowed
|
|
35
31
|
* @param {number} payment The amount paid at each period
|
|
36
|
-
* @param {number} periodicRate The rate the
|
|
32
|
+
* @param {number} periodicRate The rate the princpal accrues interest at per period
|
|
37
33
|
* @param {number [int]} periods The number of periods paid to compute the desired principal remaining
|
|
38
34
|
* @returns {number} The remaining principal
|
|
39
35
|
*/
|
|
@@ -44,8 +40,8 @@ export function principalRemaining(
|
|
|
44
40
|
periods: number
|
|
45
41
|
): number {
|
|
46
42
|
return Math.max(
|
|
47
|
-
principal * (1 + periodicRate) ** periods -
|
|
48
|
-
payment * ((
|
|
43
|
+
(principal * (1 + periodicRate) ** periods) -
|
|
44
|
+
(payment * ((1 + periodicRate) ** periods - 1) / periodicRate),
|
|
49
45
|
0
|
|
50
46
|
);
|
|
51
47
|
}
|
|
@@ -53,11 +49,9 @@ export function principalRemaining(
|
|
|
53
49
|
/**
|
|
54
50
|
* Calculates the total interest paid after a certain number of payments from a beginning principal at a periodic rate
|
|
55
51
|
*
|
|
56
|
-
* balance = principal + interest
|
|
57
|
-
*
|
|
58
52
|
* @param {number} principal The amount borrowed
|
|
59
53
|
* @param {number} payment The amount paid at each period
|
|
60
|
-
* @param {number} periodicRate The rate the
|
|
54
|
+
* @param {number} periodicRate The rate the princpal accrues interest at per period
|
|
61
55
|
* @param {number [int]} periods The number of periods paid to compute the desired principal remaining
|
|
62
56
|
* @returns {number} The total interest paid
|
|
63
57
|
*/
|
|
@@ -76,11 +70,9 @@ export function interestPaid(
|
|
|
76
70
|
/**
|
|
77
71
|
* Calculates the number of payments required to pay off a principal
|
|
78
72
|
*
|
|
79
|
-
* balance = principal + interest
|
|
80
|
-
*
|
|
81
73
|
* @param {number} principal The amount borrowed
|
|
82
74
|
* @param {number} payment The amount paid at each period
|
|
83
|
-
* @param {number} periodicRate The rate the
|
|
75
|
+
* @param {number} periodicRate The rate the princpal accrues interest at per period
|
|
84
76
|
* @returns The number of payments needed to pay off the principal
|
|
85
77
|
*/
|
|
86
78
|
export function numPaymentsToZero(
|
package/src/lib/payments.ts
CHANGED
|
@@ -18,7 +18,7 @@ import type {
|
|
|
18
18
|
* Calculates the extra amount in a payment after all loans' minimum payments are met
|
|
19
19
|
* Throws an exception if the payment provided is less than the collective minimum payments for all loans
|
|
20
20
|
*
|
|
21
|
-
* @param {
|
|
21
|
+
* @param {ILoan[]} loans The loans to allocate minimum payments
|
|
22
22
|
* @param {number} payment The amount to pay across all loans
|
|
23
23
|
* @returns {number} The extra amount of payment
|
|
24
24
|
*/
|
|
@@ -49,7 +49,7 @@ export function determineExtraPayment(
|
|
|
49
49
|
* @param {number} numPayments The number of periods to make payments to the loan
|
|
50
50
|
* @param {number} startPeriod An initial offset of periods to 'fast-forward' the state of the loan to prior to calculation of each period
|
|
51
51
|
* @param {number} carryover An additional amount to pay towards a loan, used when a residual amount is available from paying off the previous loan this period
|
|
52
|
-
* @returns {
|
|
52
|
+
* @returns {AmortizationRecord[]} The amortization schdule for the number of payments of payment made to the loan from the provided start period
|
|
53
53
|
*/
|
|
54
54
|
export function amortizePayments(
|
|
55
55
|
loan: Loan,
|
|
@@ -94,7 +94,7 @@ export function amortizePayments(
|
|
|
94
94
|
*
|
|
95
95
|
* Calculates a wealth of information about paying of a set of loans with a total payment amount
|
|
96
96
|
*
|
|
97
|
-
* @param {
|
|
97
|
+
* @param {Loan[]} loans The loans to pay off
|
|
98
98
|
* @param {number} payment The total amount of money budgeted to pay all loans each period
|
|
99
99
|
* @param {boolean} reduceMinimum Flag to reduce the total payment amount by a loan's minimum when that loan is paid off
|
|
100
100
|
* @returns {LoansPaymentSchedule} Various totals and series of data regarding paying off the loans at the payment amount
|
package/src/lib/sorting.ts
CHANGED
|
@@ -1,41 +1,41 @@
|
|
|
1
1
|
/**
|
|
2
2
|
*
|
|
3
|
-
* This file contains functions for sorting Arrays of
|
|
3
|
+
* This file contains functions for sorting Arrays of ILoans on certain attributes
|
|
4
4
|
*
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { ILoan } from './loan';
|
|
8
8
|
|
|
9
|
-
type avalanche = (loan1:
|
|
10
|
-
type snowball = (loan1:
|
|
9
|
+
type avalanche = (loan1: ILoan, loan2: ILoan) => number;
|
|
10
|
+
type snowball = (loan1: ILoan, loan2: ILoan) => number;
|
|
11
11
|
type sortFunction = avalanche | snowball;
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Sorts loans descending by interest rate
|
|
15
|
-
* @param {
|
|
16
|
-
* @param {
|
|
15
|
+
* @param {ILoan} loan1 A loan to be comapred
|
|
16
|
+
* @param {ILoan} loan2 A loan to be comapred
|
|
17
17
|
* @returns {number} the order in which to sort the loans in descending interest rate
|
|
18
18
|
*/
|
|
19
|
-
export function avalanche(loan1:
|
|
19
|
+
export function avalanche(loan1: ILoan, loan2: ILoan): number {
|
|
20
20
|
return loan2.annualRate - loan1.annualRate;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
24
|
* Sorts loans ascending by principal
|
|
25
|
-
* @param {
|
|
26
|
-
* @param {
|
|
25
|
+
* @param {ILoan} loan1 A loan to be compared
|
|
26
|
+
* @param {ILoan} loan2 A loan to be compared
|
|
27
27
|
* @returns {number} the order in which to sort the loans in ascending princpal
|
|
28
28
|
*/
|
|
29
|
-
export function snowball(loan1:
|
|
29
|
+
export function snowball(loan1: ILoan, loan2: ILoan): number {
|
|
30
30
|
return loan1.currentBalance - loan2.currentBalance;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
34
|
* Sorts an array of loans using the provided sortFunc
|
|
35
|
-
* @param {
|
|
35
|
+
* @param {ILoan[]} loans The loans to sort
|
|
36
36
|
* @param {function} sortFunc The algorithm to sort the loans with
|
|
37
37
|
* @returns The sorted array loans
|
|
38
38
|
*/
|
|
39
|
-
export function sortLoans(loans:
|
|
39
|
+
export function sortLoans(loans: ILoan[], sortFunction: sortFunction): ILoan[] {
|
|
40
40
|
return loans.sort(sortFunction);
|
|
41
41
|
}
|