moneyfunx 0.0.24 → 0.0.27

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "moneyfunx",
3
3
  "type": "module",
4
- "version": "0.0.24",
4
+ "version": "0.0.27",
5
5
  "description": "MoneyFunx is a small library of functions for financial computations, with a focus on personal finance",
6
6
  "main": "src/index.js",
7
7
  "scripts": {
package/src/lib/loan.js CHANGED
@@ -1,14 +1,14 @@
1
- /*
2
-
3
- *****************
4
- *** MoneyFunx ***
5
- *****************
6
-
7
- mek it funx up
8
-
9
- This library contains functions used to in personal financial analysis
10
-
11
- */
1
+ /**
2
+ *
3
+ * *****************
4
+ * *** MoneyFunx ***
5
+ * *****************
6
+ *
7
+ * mek it funx up
8
+ *
9
+ * This library contains functions used to in personal financial analysis
10
+ *
11
+ */
12
12
 
13
13
  /**
14
14
  * Calculates the minimum payment to pay the principal back in the number of periods at the periodic rate
@@ -1,6 +1,9 @@
1
- /*
1
+ /**
2
+ *
3
+ * This file contains functions for computing detailed information on paying loans
4
+ *
5
+ */
2
6
 
3
- */
4
7
  import * as loanLib from "./loan";
5
8
 
6
9
  /**
@@ -1,8 +1,8 @@
1
- /*
2
-
3
- NOTE: When sorting by avalanche, sort by snowball first for optimal interest minimization
4
-
5
- */
1
+ /**
2
+ *
3
+ * This file contains functions for sorting Arrays of Loans on certain attributes
4
+ *
5
+ */
6
6
 
7
7
  /**
8
8
  * Sorts loans descending by interest rate
@@ -10,7 +10,7 @@ NOTE: When sorting by avalanche, sort by snowball first for optimal interest min
10
10
  * @param {Loan} loan2 A loan to be comapred
11
11
  * @returns {number} the order in which to sort the loans in descending interest rate
12
12
  */
13
- export function snowball(loan1, loan2) {
13
+ export function avalanche(loan1, loan2) {
14
14
  return loan2.annualRate - loan1.annualRate;
15
15
  }
16
16
 
@@ -20,7 +20,7 @@ export function snowball(loan1, loan2) {
20
20
  * @param {Loan} 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 function avalanche(loan1, loan2) {
23
+ export function snowball(loan1, loan2) {
24
24
  return loan1.principal - loan2.principal;
25
25
  }
26
26