moneyfunx 1.1.0 → 1.1.2
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/LICENSE +2 -2
- package/build/index.d.ts +6 -5
- package/build/index.js +7 -7
- package/coverage/clover.xml +6 -5
- package/coverage/coverage-final.json +1 -1
- package/coverage/index.html +5 -5
- package/coverage/src/index.html +5 -5
- package/coverage/src/index.ts.html +17 -11
- 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 +1 -1
- 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 +1 -1
- package/coverage/src/lib/sorting.ts.html +1 -1
- package/package.json +1 -1
- package/src/index.ts +9 -7
package/LICENSE
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
Copyright 2022-
|
|
1
|
+
Copyright 2022-2025 by Kyle Pekosh
|
|
2
2
|
|
|
3
3
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
4
|
|
|
5
5
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
6
6
|
|
|
7
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/build/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { PaymentTooLowError } from './lib/errors
|
|
2
|
-
import { calculateMinPayment, numPaymentsToZero, principalRemaining, interestPaid } from './lib/helperFunctions
|
|
3
|
-
import { Loan } from './lib/loan
|
|
4
|
-
import { determineExtraPayment, amortizePayments, payLoans } from './lib/payments
|
|
5
|
-
import { snowball, avalanche, sortLoans } from './lib/sorting
|
|
1
|
+
import { PaymentTooLowError } from './lib/errors';
|
|
2
|
+
import { calculateMinPayment, numPaymentsToZero, principalRemaining, interestPaid } from './lib/helperFunctions';
|
|
3
|
+
import { Loan } from './lib/loan';
|
|
4
|
+
import { determineExtraPayment, amortizePayments, payLoans } from './lib/payments';
|
|
5
|
+
import { snowball, avalanche, sortLoans } from './lib/sorting';
|
|
6
6
|
export declare const moneyfunx: {
|
|
7
7
|
amortizePayments: typeof amortizePayments;
|
|
8
8
|
avalanche: typeof avalanche;
|
|
@@ -18,4 +18,5 @@ export declare const moneyfunx: {
|
|
|
18
18
|
sortLoans: typeof sortLoans;
|
|
19
19
|
TOTALS: string;
|
|
20
20
|
};
|
|
21
|
+
export { ILoan } from './lib/loan';
|
|
21
22
|
export default moneyfunx;
|
package/build/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
// src/index
|
|
2
|
-
import { PaymentTooLowError } from './lib/errors
|
|
3
|
-
import { calculateMinPayment, numPaymentsToZero, principalRemaining, interestPaid, } from './lib/helperFunctions
|
|
4
|
-
import { Loan } from './lib/loan
|
|
5
|
-
import { determineExtraPayment, amortizePayments, payLoans, } from './lib/payments
|
|
6
|
-
import { snowball, avalanche, sortLoans } from './lib/sorting
|
|
7
|
-
import { TOTALS } from './lib/constants
|
|
1
|
+
// src/index
|
|
2
|
+
import { PaymentTooLowError } from './lib/errors';
|
|
3
|
+
import { calculateMinPayment, numPaymentsToZero, principalRemaining, interestPaid, } from './lib/helperFunctions';
|
|
4
|
+
import { Loan } from './lib/loan';
|
|
5
|
+
import { determineExtraPayment, amortizePayments, payLoans, } from './lib/payments';
|
|
6
|
+
import { snowball, avalanche, sortLoans } from './lib/sorting';
|
|
7
|
+
import { TOTALS } from './lib/constants';
|
|
8
8
|
export const moneyfunx = {
|
|
9
9
|
amortizePayments,
|
|
10
10
|
avalanche,
|
package/coverage/clover.xml
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<coverage generated="
|
|
3
|
-
<project timestamp="
|
|
4
|
-
<metrics statements="
|
|
2
|
+
<coverage generated="1738194953139" clover="3.2.0">
|
|
3
|
+
<project timestamp="1738194953139" name="All files">
|
|
4
|
+
<metrics statements="344" coveredstatements="344" conditionals="50" coveredconditionals="50" methods="19" coveredmethods="19" elements="413" coveredelements="413" complexity="0" loc="344" ncloc="344" packages="2" files="8" classes="8"/>
|
|
5
5
|
<package name="src">
|
|
6
|
-
<metrics statements="
|
|
6
|
+
<metrics statements="23" coveredstatements="23" conditionals="0" coveredconditionals="0" methods="0" coveredmethods="0"/>
|
|
7
7
|
<file name="index.ts" path="/home/runner/work/moneyfunx/moneyfunx/src/index.ts">
|
|
8
|
-
<metrics statements="
|
|
8
|
+
<metrics statements="23" coveredstatements="23" conditionals="0" coveredconditionals="0" methods="0" coveredmethods="0"/>
|
|
9
9
|
<line num="2" count="1" type="stmt"/>
|
|
10
10
|
<line num="3" count="1" type="stmt"/>
|
|
11
11
|
<line num="9" count="1" type="stmt"/>
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
<line num="31" count="1" type="stmt"/>
|
|
29
29
|
<line num="32" count="1" type="stmt"/>
|
|
30
30
|
<line num="34" count="1" type="stmt"/>
|
|
31
|
+
<line num="36" count="1" type="stmt"/>
|
|
31
32
|
</file>
|
|
32
33
|
</package>
|
|
33
34
|
<package name="src.lib">
|
|
@@ -1,4 +1,4 @@
|
|
|
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":
|
|
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":50}},"2":{"start":{"line":3,"column":0},"end":{"line":3,"column":8}},"8":{"start":{"line":9,"column":0},"end":{"line":9,"column":34}},"9":{"start":{"line":10,"column":0},"end":{"line":10,"column":8}},"14":{"start":{"line":15,"column":0},"end":{"line":15,"column":63}},"15":{"start":{"line":16,"column":0},"end":{"line":16,"column":41}},"17":{"start":{"line":18,"column":0},"end":{"line":18,"column":26}},"18":{"start":{"line":19,"column":0},"end":{"line":19,"column":19}},"19":{"start":{"line":20,"column":0},"end":{"line":20,"column":12}},"20":{"start":{"line":21,"column":0},"end":{"line":21,"column":22}},"21":{"start":{"line":22,"column":0},"end":{"line":22,"column":24}},"22":{"start":{"line":23,"column":0},"end":{"line":23,"column":15}},"23":{"start":{"line":24,"column":0},"end":{"line":24,"column":7}},"24":{"start":{"line":25,"column":0},"end":{"line":25,"column":20}},"25":{"start":{"line":26,"column":0},"end":{"line":26,"column":11}},"26":{"start":{"line":27,"column":0},"end":{"line":27,"column":21}},"27":{"start":{"line":28,"column":0},"end":{"line":28,"column":21}},"28":{"start":{"line":29,"column":0},"end":{"line":29,"column":11}},"29":{"start":{"line":30,"column":0},"end":{"line":30,"column":12}},"30":{"start":{"line":31,"column":0},"end":{"line":31,"column":9}},"31":{"start":{"line":32,"column":0},"end":{"line":32,"column":2}},"33":{"start":{"line":34,"column":0},"end":{"line":34,"column":34}},"35":{"start":{"line":36,"column":0},"end":{"line":36,"column":25}}},"s":{"1":1,"2":1,"8":1,"9":1,"14":1,"15":1,"17":1,"18":1,"19":1,"20":1,"21":1,"22":1,"23":1,"24":1,"25":1,"26":1,"27":1,"28":1,"29":1,"30":1,"31":1,"33":1,"35":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
4
|
,"/home/runner/work/moneyfunx/moneyfunx/src/lib/helperFunctions.ts": {"path":"/home/runner/work/moneyfunx/moneyfunx/src/lib/helperFunctions.ts","all":false,"statementMap":{"16":{"start":{"line":17,"column":0},"end":{"line":17,"column":36}},"17":{"start":{"line":18,"column":0},"end":{"line":18,"column":20}},"18":{"start":{"line":19,"column":0},"end":{"line":19,"column":23}},"19":{"start":{"line":20,"column":0},"end":{"line":20,"column":17}},"20":{"start":{"line":21,"column":0},"end":{"line":21,"column":11}},"21":{"start":{"line":22,"column":0},"end":{"line":22,"column":25}},"22":{"start":{"line":23,"column":0},"end":{"line":23,"column":17}},"23":{"start":{"line":24,"column":0},"end":{"line":24,"column":53}},"24":{"start":{"line":25,"column":0},"end":{"line":25,"column":42}},"25":{"start":{"line":26,"column":0},"end":{"line":26,"column":26}},"26":{"start":{"line":27,"column":0},"end":{"line":27,"column":1}},"39":{"start":{"line":40,"column":0},"end":{"line":40,"column":35}},"40":{"start":{"line":41,"column":0},"end":{"line":41,"column":20}},"41":{"start":{"line":42,"column":0},"end":{"line":42,"column":18}},"42":{"start":{"line":43,"column":0},"end":{"line":43,"column":23}},"43":{"start":{"line":44,"column":0},"end":{"line":44,"column":17}},"44":{"start":{"line":45,"column":0},"end":{"line":45,"column":11}},"45":{"start":{"line":46,"column":0},"end":{"line":46,"column":18}},"46":{"start":{"line":47,"column":0},"end":{"line":47,"column":47}},"47":{"start":{"line":48,"column":0},"end":{"line":48,"column":67}},"48":{"start":{"line":49,"column":0},"end":{"line":49,"column":5}},"49":{"start":{"line":50,"column":0},"end":{"line":50,"column":4}},"50":{"start":{"line":51,"column":0},"end":{"line":51,"column":1}},"63":{"start":{"line":64,"column":0},"end":{"line":64,"column":29}},"64":{"start":{"line":65,"column":0},"end":{"line":65,"column":20}},"65":{"start":{"line":66,"column":0},"end":{"line":66,"column":18}},"66":{"start":{"line":67,"column":0},"end":{"line":67,"column":23}},"67":{"start":{"line":68,"column":0},"end":{"line":68,"column":17}},"68":{"start":{"line":69,"column":0},"end":{"line":69,"column":11}},"69":{"start":{"line":70,"column":0},"end":{"line":70,"column":10}},"70":{"start":{"line":71,"column":0},"end":{"line":71,"column":23}},"71":{"start":{"line":72,"column":0},"end":{"line":72,"column":79}},"73":{"start":{"line":74,"column":0},"end":{"line":74,"column":1}},"85":{"start":{"line":86,"column":0},"end":{"line":86,"column":34}},"86":{"start":{"line":87,"column":0},"end":{"line":87,"column":20}},"87":{"start":{"line":88,"column":0},"end":{"line":88,"column":18}},"88":{"start":{"line":89,"column":0},"end":{"line":89,"column":22}},"89":{"start":{"line":90,"column":0},"end":{"line":90,"column":11}},"90":{"start":{"line":91,"column":0},"end":{"line":91,"column":19}},"91":{"start":{"line":92,"column":0},"end":{"line":92,"column":62}},"92":{"start":{"line":93,"column":0},"end":{"line":93,"column":30}},"93":{"start":{"line":94,"column":0},"end":{"line":94,"column":4}},"94":{"start":{"line":95,"column":0},"end":{"line":95,"column":1}}},"s":{"16":1,"17":9,"18":9,"19":9,"20":9,"21":9,"22":8,"23":8,"24":8,"25":1,"26":9,"39":1,"40":30,"41":30,"42":30,"43":30,"44":30,"45":30,"46":30,"47":30,"48":30,"49":30,"50":30,"63":1,"64":9,"65":9,"66":9,"67":9,"68":9,"69":9,"70":9,"71":9,"73":9,"85":1,"86":49,"87":49,"88":49,"89":49,"90":49,"91":49,"92":49,"93":49,"94":49},"branchMap":{"0":{"type":"branch","line":17,"loc":{"start":{"line":17,"column":7},"end":{"line":27,"column":1}},"locations":[{"start":{"line":17,"column":7},"end":{"line":27,"column":1}}]},"1":{"type":"branch","line":22,"loc":{"start":{"line":22,"column":24},"end":{"line":25,"column":42}},"locations":[{"start":{"line":22,"column":24},"end":{"line":25,"column":42}}]},"2":{"type":"branch","line":25,"loc":{"start":{"line":25,"column":39},"end":{"line":26,"column":26}},"locations":[{"start":{"line":25,"column":39},"end":{"line":26,"column":26}}]},"3":{"type":"branch","line":40,"loc":{"start":{"line":40,"column":7},"end":{"line":51,"column":1}},"locations":[{"start":{"line":40,"column":7},"end":{"line":51,"column":1}}]},"4":{"type":"branch","line":64,"loc":{"start":{"line":64,"column":7},"end":{"line":74,"column":1}},"locations":[{"start":{"line":64,"column":7},"end":{"line":74,"column":1}}]},"5":{"type":"branch","line":86,"loc":{"start":{"line":86,"column":7},"end":{"line":95,"column":1}},"locations":[{"start":{"line":86,"column":7},"end":{"line":95,"column":1}}]}},"b":{"0":[9],"1":[8],"2":[1],"3":[30],"4":[9],"5":[49]},"fnMap":{"0":{"name":"calculateMinPayment","decl":{"start":{"line":17,"column":7},"end":{"line":27,"column":1}},"loc":{"start":{"line":17,"column":7},"end":{"line":27,"column":1}},"line":17},"1":{"name":"principalRemaining","decl":{"start":{"line":40,"column":7},"end":{"line":51,"column":1}},"loc":{"start":{"line":40,"column":7},"end":{"line":51,"column":1}},"line":40},"2":{"name":"interestPaid","decl":{"start":{"line":64,"column":7},"end":{"line":74,"column":1}},"loc":{"start":{"line":64,"column":7},"end":{"line":74,"column":1}},"line":64},"3":{"name":"numPaymentsToZero","decl":{"start":{"line":86,"column":7},"end":{"line":95,"column":1}},"loc":{"start":{"line":86,"column":7},"end":{"line":95,"column":1}},"line":86}},"f":{"0":9,"1":30,"2":9,"3":49}}
|
package/coverage/index.html
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
26
|
<span class="strong">100% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>
|
|
28
|
+
<span class='fraction'>344/344</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
|
47
47
|
<span class="strong">100% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>
|
|
49
|
+
<span class='fraction'>344/344</span>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
|
|
@@ -84,13 +84,13 @@
|
|
|
84
84
|
<div class="chart"><div class="cover-fill cover-full" style="width: 100%"></div><div class="cover-empty" style="width: 0%"></div></div>
|
|
85
85
|
</td>
|
|
86
86
|
<td data-value="100" class="pct high">100%</td>
|
|
87
|
-
<td data-value="
|
|
87
|
+
<td data-value="23" class="abs high">23/23</td>
|
|
88
88
|
<td data-value="100" class="pct high">100%</td>
|
|
89
89
|
<td data-value="0" class="abs high">0/0</td>
|
|
90
90
|
<td data-value="100" class="pct high">100%</td>
|
|
91
91
|
<td data-value="0" class="abs high">0/0</td>
|
|
92
92
|
<td data-value="100" class="pct high">100%</td>
|
|
93
|
-
<td data-value="
|
|
93
|
+
<td data-value="23" class="abs high">23/23</td>
|
|
94
94
|
</tr>
|
|
95
95
|
|
|
96
96
|
<tr>
|
|
@@ -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-01-
|
|
119
|
+
at 2025-01-29T23:55:53.130Z
|
|
120
120
|
</div>
|
|
121
121
|
<script src="prettify.js"></script>
|
|
122
122
|
<script>
|
package/coverage/src/index.html
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
26
|
<span class="strong">100% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>
|
|
28
|
+
<span class='fraction'>23/23</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
|
47
47
|
<span class="strong">100% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>
|
|
49
|
+
<span class='fraction'>23/23</span>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
|
|
@@ -84,13 +84,13 @@
|
|
|
84
84
|
<div class="chart"><div class="cover-fill cover-full" style="width: 100%"></div><div class="cover-empty" style="width: 0%"></div></div>
|
|
85
85
|
</td>
|
|
86
86
|
<td data-value="100" class="pct high">100%</td>
|
|
87
|
-
<td data-value="
|
|
87
|
+
<td data-value="23" class="abs high">23/23</td>
|
|
88
88
|
<td data-value="100" class="pct high">100%</td>
|
|
89
89
|
<td data-value="0" class="abs high">0/0</td>
|
|
90
90
|
<td data-value="100" class="pct high">100%</td>
|
|
91
91
|
<td data-value="0" class="abs high">0/0</td>
|
|
92
92
|
<td data-value="100" class="pct high">100%</td>
|
|
93
|
-
<td data-value="
|
|
93
|
+
<td data-value="23" class="abs high">23/23</td>
|
|
94
94
|
</tr>
|
|
95
95
|
|
|
96
96
|
</tbody>
|
|
@@ -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-01-
|
|
104
|
+
at 2025-01-29T23:55:53.130Z
|
|
105
105
|
</div>
|
|
106
106
|
<script src="../prettify.js"></script>
|
|
107
107
|
<script>
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
26
|
<span class="strong">100% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>
|
|
28
|
+
<span class='fraction'>23/23</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
|
47
47
|
<span class="strong">100% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>
|
|
49
|
+
<span class='fraction'>23/23</span>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
|
|
@@ -97,7 +97,9 @@
|
|
|
97
97
|
<a name='L32'></a><a href='#L32'>32</a>
|
|
98
98
|
<a name='L33'></a><a href='#L33'>33</a>
|
|
99
99
|
<a name='L34'></a><a href='#L34'>34</a>
|
|
100
|
-
<a name='L35'></a><a href='#L35'>35</a
|
|
100
|
+
<a name='L35'></a><a href='#L35'>35</a>
|
|
101
|
+
<a name='L36'></a><a href='#L36'>36</a>
|
|
102
|
+
<a name='L37'></a><a href='#L37'>37</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
101
103
|
<span class="cline-any cline-yes">1x</span>
|
|
102
104
|
<span class="cline-any cline-yes">1x</span>
|
|
103
105
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -131,22 +133,24 @@
|
|
|
131
133
|
<span class="cline-any cline-yes">1x</span>
|
|
132
134
|
<span class="cline-any cline-neutral"> </span>
|
|
133
135
|
<span class="cline-any cline-yes">1x</span>
|
|
134
|
-
<span class="cline-any cline-neutral"> </span
|
|
135
|
-
|
|
136
|
+
<span class="cline-any cline-neutral"> </span>
|
|
137
|
+
<span class="cline-any cline-yes">1x</span>
|
|
138
|
+
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">// src/index
|
|
139
|
+
import { PaymentTooLowError } from './lib/errors';
|
|
136
140
|
import {
|
|
137
141
|
calculateMinPayment,
|
|
138
142
|
numPaymentsToZero,
|
|
139
143
|
principalRemaining,
|
|
140
144
|
interestPaid,
|
|
141
|
-
} from './lib/helperFunctions
|
|
142
|
-
import { Loan } from './lib/loan
|
|
145
|
+
} from './lib/helperFunctions';
|
|
146
|
+
import { Loan } from './lib/loan';
|
|
143
147
|
import {
|
|
144
148
|
determineExtraPayment,
|
|
145
149
|
amortizePayments,
|
|
146
150
|
payLoans,
|
|
147
|
-
} from './lib/payments
|
|
148
|
-
import { snowball, avalanche, sortLoans } from './lib/sorting
|
|
149
|
-
import { TOTALS } from './lib/constants
|
|
151
|
+
} from './lib/payments';
|
|
152
|
+
import { snowball, avalanche, sortLoans } from './lib/sorting';
|
|
153
|
+
import { TOTALS } from './lib/constants';
|
|
150
154
|
|
|
151
155
|
export const moneyfunx = {
|
|
152
156
|
amortizePayments,
|
|
@@ -164,6 +168,8 @@ export const moneyfunx = {
|
|
|
164
168
|
TOTALS,
|
|
165
169
|
};
|
|
166
170
|
|
|
171
|
+
export { ILoan } from './lib/loan'
|
|
172
|
+
|
|
167
173
|
export default moneyfunx;
|
|
168
174
|
</pre></td></tr></table></pre>
|
|
169
175
|
|
|
@@ -172,7 +178,7 @@ export default moneyfunx;
|
|
|
172
178
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
173
179
|
Code coverage generated by
|
|
174
180
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
175
|
-
at 2025-01-
|
|
181
|
+
at 2025-01-29T23:55:53.130Z
|
|
176
182
|
</div>
|
|
177
183
|
<script src="../prettify.js"></script>
|
|
178
184
|
<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-01-
|
|
73
|
+
at 2025-01-29T23:55:53.130Z
|
|
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-01-
|
|
94
|
+
at 2025-01-29T23:55:53.130Z
|
|
95
95
|
</div>
|
|
96
96
|
<script src="../../prettify.js"></script>
|
|
97
97
|
<script>
|
|
@@ -355,7 +355,7 @@ export function numPaymentsToZero(
|
|
|
355
355
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
356
356
|
Code coverage generated by
|
|
357
357
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
358
|
-
at 2025-01-
|
|
358
|
+
at 2025-01-29T23:55:53.130Z
|
|
359
359
|
</div>
|
|
360
360
|
<script src="../../prettify.js"></script>
|
|
361
361
|
<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-01-
|
|
194
|
+
at 2025-01-29T23:55:53.130Z
|
|
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-01-
|
|
607
|
+
at 2025-01-29T23:55:53.130Z
|
|
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-01-
|
|
121
|
+
at 2025-01-29T23:55:53.130Z
|
|
122
122
|
</div>
|
|
123
123
|
<script src="../../prettify.js"></script>
|
|
124
124
|
<script>
|
|
@@ -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-01-
|
|
787
|
+
at 2025-01-29T23:55:53.130Z
|
|
788
788
|
</div>
|
|
789
789
|
<script src="../../prettify.js"></script>
|
|
790
790
|
<script>
|
|
@@ -193,7 +193,7 @@ export function sortLoans(loans: ILoan[], sortFunction: sortFunction) {
|
|
|
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-01-
|
|
196
|
+
at 2025-01-29T23:55:53.130Z
|
|
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.1.
|
|
4
|
+
"version": "1.1.2",
|
|
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",
|
package/src/index.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
// src/index
|
|
2
|
-
import { PaymentTooLowError } from './lib/errors
|
|
1
|
+
// src/index
|
|
2
|
+
import { PaymentTooLowError } from './lib/errors';
|
|
3
3
|
import {
|
|
4
4
|
calculateMinPayment,
|
|
5
5
|
numPaymentsToZero,
|
|
6
6
|
principalRemaining,
|
|
7
7
|
interestPaid,
|
|
8
|
-
} from './lib/helperFunctions
|
|
9
|
-
import { Loan } from './lib/loan
|
|
8
|
+
} from './lib/helperFunctions';
|
|
9
|
+
import { Loan } from './lib/loan';
|
|
10
10
|
import {
|
|
11
11
|
determineExtraPayment,
|
|
12
12
|
amortizePayments,
|
|
13
13
|
payLoans,
|
|
14
|
-
} from './lib/payments
|
|
15
|
-
import { snowball, avalanche, sortLoans } from './lib/sorting
|
|
16
|
-
import { TOTALS } from './lib/constants
|
|
14
|
+
} from './lib/payments';
|
|
15
|
+
import { snowball, avalanche, sortLoans } from './lib/sorting';
|
|
16
|
+
import { TOTALS } from './lib/constants';
|
|
17
17
|
|
|
18
18
|
export const moneyfunx = {
|
|
19
19
|
amortizePayments,
|
|
@@ -31,4 +31,6 @@ export const moneyfunx = {
|
|
|
31
31
|
TOTALS,
|
|
32
32
|
};
|
|
33
33
|
|
|
34
|
+
export { ILoan } from './lib/loan'
|
|
35
|
+
|
|
34
36
|
export default moneyfunx;
|