+15
-34
| "use strict"; | ||
| function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } | ||
| (function () { | ||
| (function (global, factory) { | ||
| (typeof exports === "undefined" ? "undefined" : _typeof(exports)) === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.loan = factory()); | ||
| })(void 0, function () { | ||
| 'use strict'; | ||
@@ -12,3 +14,3 @@ | ||
| * | ||
| * Copyright (c) 2014 Grzegorz Klimek | ||
| * Copyright (c) 2023 Grzegorz Klimek | ||
| * Licensed under the MIT license. | ||
@@ -32,3 +34,3 @@ */ | ||
| * | ||
| * Copyright (c) 2014 Grzegorz Klimek | ||
| * Copyright (c) 2023 Grzegorz Klimek | ||
| * Licensed under the MIT license. | ||
@@ -38,11 +40,3 @@ */ | ||
| /** | ||
| * Method to getting next instalment | ||
| * @param {number} amount | ||
| * @param {number} installmentsNumber | ||
| * @param {number} interestRate | ||
| * @param {boolean} diminishing | ||
| * @param {number} capitalSum | ||
| * @param {number} interestSum | ||
| * | ||
| * @returns {{ capital: number, interest: number, installment: number, remain: number, interestSum: number }} | ||
| * @type {import("../types").GetNextInstalmentFunction} | ||
| */ | ||
@@ -75,14 +69,6 @@ var getNextInstalment = function getNextInstalment(amount, installmentsNumber, interestRate, diminishing, capitalSum, interestSum) { | ||
| /** | ||
| * Create Loan Object with all installments and sum of interest | ||
| * | ||
| * @param {number} amount full amount of Loan | ||
| * @param {number} installmentsNumber how many installments will be | ||
| * @param {number} interestRate interest rate in percent (3.5) equal/annuity (false) | ||
| * @param {boolean} diminishing if installments will be diminishing (true) or not | ||
| * | ||
| * @return {object} | ||
| * @type {import('../types').LoanFunction} | ||
| */ | ||
| function Loan(amount, installmentsNumber, interestRate) { | ||
| var diminishing = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; | ||
| /** Checking params */ | ||
| if (!amount || amount <= 0 || !installmentsNumber || installmentsNumber <= 0 || !interestRate || interestRate <= 0) { | ||
@@ -118,16 +104,11 @@ throw new Error("wrong parameters: ".concat(amount, " ").concat(installmentsNumber, " ").concat(interestRate)); | ||
| /* istanbul ignore next */ | ||
| if (typeof module === 'undefined') { | ||
| // browser | ||
| if ((typeof LOANJS_NAMESPACE === "undefined" ? "undefined" : _typeof(LOANJS_NAMESPACE)) === 'object') { | ||
| LOANJS_NAMESPACE.Loan = Loan; // eslint-disable-line no-undef | ||
| } else { | ||
| if (!window.LoanJS) { | ||
| window.LoanJS = {}; | ||
| } | ||
| window.LoanJS.Loan = Loan; | ||
| if (typeof window !== 'undefined') { | ||
| /** @type {any} */ | ||
| var localWindow = window; | ||
| if (!localWindow.LoanJS) { | ||
| localWindow.LoanJS = {}; | ||
| } | ||
| } else { | ||
| // node or browserfy | ||
| module.exports = Loan; | ||
| localWindow.LoanJS.Loan = Loan; | ||
| } | ||
| })(); | ||
| return Loan; | ||
| }); |
+1
-1
@@ -1,1 +0,1 @@ | ||
| "use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}!function(){function A(t){return Math.round(100*t)/100}function t(t,n,o){var e=3<arguments.length&&void 0!==arguments[3]&&arguments[3];if(!t||t<=0||!n||n<=0||!o||o<=0)throw new Error("wrong parameters: ".concat(t," ").concat(n," ").concat(o));for(var r,i,a,u,f,m,c,l,p=[],y=0,s=0,S=0,d=0;d<n;d++){r=t,w=n,i=o,u=s,f=y,l=c=m=void 0,i/=1200,(a=e)?l=(m=A(r/w))+(c=A((r-u)*i)):m=(l=A(r*(i*(a=Math.pow(1+i,w))/(a-1))))-(c=A((r-u)*i));var w={capital:m,interest:c,installment:l,remain:r-u-m,interestSum:f+c};S+=w.installment,s+=w.capital,y+=w.interest,d===n-1&&(s+=w.remain,S+=w.remain,w.remain=0),p.push(w)}return{installments:p,amount:A(t),interestSum:A(y),capitalSum:A(s),sum:A(S)}}"undefined"==typeof module?"object"===("undefined"==typeof LOANJS_NAMESPACE?"undefined":_typeof(LOANJS_NAMESPACE))?LOANJS_NAMESPACE.Loan=t:(window.LoanJS||(window.LoanJS={}),window.LoanJS.Loan=t):module.exports=t}(); | ||
| "use strict";function _typeof(n){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n})(n)}!function(n){"object"===("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):("undefined"!=typeof globalThis?globalThis:self).loan=n()}(function(){function w(n){return Math.round(100*n)/100}var n;function t(n,t,e){var o=3<arguments.length&&void 0!==arguments[3]&&arguments[3];if(!n||n<=0||!t||t<=0||!e||e<=0)throw new Error("wrong parameters: ".concat(n," ").concat(t," ").concat(e));for(var r,i,a,f,u,l,p,c,m=[],s=0,d=0,y=0,S=0;S<t;S++){r=n,b=t,i=e,f=d,u=s,c=p=l=void 0,i/=1200,(a=o)?c=(l=w(r/b))+(p=w((r-f)*i)):l=(c=w(r*(i*(a=Math.pow(1+i,b))/(a-1))))-(p=w((r-f)*i));var b={capital:l,interest:p,installment:c,remain:r-f-l,interestSum:u+p};y+=b.installment,d+=b.capital,s+=b.interest,S===t-1&&(d+=b.remain,y+=b.remain,b.remain=0),m.push(b)}return{installments:m,amount:w(n),interestSum:w(s),capitalSum:w(d),sum:w(y)}}return"undefined"!=typeof window&&((n=window).LoanJS||(n.LoanJS={}),n.LoanJS.Loan=t),t}); |
+18
-26
| "use strict"; | ||
| function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } | ||
| (function () { | ||
| (function (global, factory) { | ||
| (typeof exports === "undefined" ? "undefined" : _typeof(exports)) === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.loanToHtmlTable = factory()); | ||
| })(void 0, function () { | ||
| 'use strict'; | ||
| /** | ||
| * Create Loan Object with all installments and sum of interest | ||
| * @param {Loan} loan loan object | ||
| * @param {object} params params | ||
| * | ||
| * @return {string} html string with table | ||
| * @type {import("../types").LoanToHtmlTableFunction} | ||
| */ | ||
| function loanToHtmlTable(loan, params) { | ||
| params = params || {}; | ||
| function loanToHtmlTable(loan) { | ||
| var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
| params.formatMoney = params.formatMoney || function (num) { | ||
@@ -20,8 +18,7 @@ return num.toFixed(2); | ||
| var fm = params.formatMoney; | ||
| /** @param {string} key */ | ||
| var trans = function trans(key) { | ||
| if (params.translations && params.translations[key]) { | ||
| return params.translations[key]; | ||
| } else { | ||
| return key; | ||
| } | ||
| var _params$translations; | ||
| return (params === null || params === void 0 ? void 0 : (_params$translations = params.translations) === null || _params$translations === void 0 ? void 0 : _params$translations[key]) || key; | ||
| }; | ||
@@ -41,16 +38,11 @@ var html = ['<table>' + '<thead>' + '<tr>' + '<th></th>' + '<th>' + trans('Capital') + '</th>' + '<th>' + trans('Interest') + '</th>' + '<th>' + trans('Instalment') + '</th>' + '<th>' + trans('Remain') + '</th>' + '<th>' + trans('Interest sum') + '</th>' + '</tr>' + '</thead>' + '<tbody>', '', | ||
| /* istanbul ignore next */ | ||
| if (typeof module === 'undefined') { | ||
| // browser | ||
| if ((typeof LOANJS_NAMESPACE === "undefined" ? "undefined" : _typeof(LOANJS_NAMESPACE)) === 'object') { | ||
| LOANJS_NAMESPACE.loanToHtmlTable = loanToHtmlTable; // eslint-disable-line no-undef | ||
| } else { | ||
| if (!window.LoanJS) { | ||
| window.LoanJS = {}; | ||
| } | ||
| window.LoanJS.loanToHtmlTable = loanToHtmlTable; | ||
| if (typeof window !== 'undefined') { | ||
| /** @type {any} */ | ||
| var localWindow = window; | ||
| if (!localWindow.LoanJS) { | ||
| localWindow.LoanJS = {}; | ||
| } | ||
| } else { | ||
| // node or browserfy | ||
| module.exports = loanToHtmlTable; | ||
| localWindow.LoanJS.loanToHtmlTable = loanToHtmlTable; | ||
| } | ||
| })(); | ||
| return loanToHtmlTable; | ||
| }); |
@@ -1,1 +0,1 @@ | ||
| "use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}!function(){function t(t,n){(n=n||{}).formatMoney=n.formatMoney||function(t){return t.toFixed(2)};for(var o=n.formatMoney,e=function(t){return n.translations&&n.translations[t]?n.translations[t]:t},d=["<table><thead><tr><th></th><th>"+e("Capital")+"</th><th>"+e("Interest")+"</th><th>"+e("Instalment")+"</th><th>"+e("Remain")+"</th><th>"+e("Interest sum")+"</th></tr></thead><tbody>","","</tbody></table>"],r=0;r<t.installments.length;r++){var a=t.installments[r],a="<tr><td>"+(r+1)+"</td><td>"+o(a.capital)+"</td><td>"+o(a.interest)+"</td><td>"+o(a.installment)+"</td><td>"+o(a.remain)+"</td><td>"+o(a.interestSum)+"</td></tr>";d[1]+=a}return d[1]+="<tr><td>"+e("sum")+"</td><td>"+o(t.capitalSum)+"</td><td>"+o(t.interestSum)+"</td><td>"+o(t.sum)+"</td><td>-</td><td>-</td></tr>",d.join("")}"undefined"==typeof module?"object"===("undefined"==typeof LOANJS_NAMESPACE?"undefined":_typeof(LOANJS_NAMESPACE))?LOANJS_NAMESPACE.loanToHtmlTable=t:(window.LoanJS||(window.LoanJS={}),window.LoanJS.loanToHtmlTable=t):module.exports=t}(); | ||
| "use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}!function(t){"object"===("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):("undefined"!=typeof globalThis?globalThis:self).loanToHtmlTable=t()}(function(){function t(t){for(var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=(e.formatMoney=e.formatMoney||function(t){return t.toFixed(2)},e.formatMoney),o=function(t){var n;return(null==e||null==(n=e.translations)?void 0:n[t])||t},d=["<table><thead><tr><th></th><th>"+o("Capital")+"</th><th>"+o("Interest")+"</th><th>"+o("Instalment")+"</th><th>"+o("Remain")+"</th><th>"+o("Interest sum")+"</th></tr></thead><tbody>","","</tbody></table>"],r=0;r<t.installments.length;r++){var i=t.installments[r],i="<tr><td>"+(r+1)+"</td><td>"+n(i.capital)+"</td><td>"+n(i.interest)+"</td><td>"+n(i.installment)+"</td><td>"+n(i.remain)+"</td><td>"+n(i.interestSum)+"</td></tr>";d[1]+=i}return d[1]+="<tr><td>"+o("sum")+"</td><td>"+n(t.capitalSum)+"</td><td>"+n(t.interestSum)+"</td><td>"+n(t.sum)+"</td><td>-</td><td>-</td></tr>",d.join("")}var n;return"undefined"!=typeof window&&((n=window).LoanJS||(n.LoanJS={}),n.LoanJS.loanToHtmlTable=t),t}); |
+34
-37
@@ -6,3 +6,3 @@ /* | ||
| * | ||
| * Copyright (c) 2014 Grzegorz Klimek | ||
| * Copyright (c) 2023 Grzegorz Klimek | ||
| * Licensed under the MIT license. | ||
@@ -14,14 +14,11 @@ */ | ||
| /** | ||
| * Method to getting next instalment | ||
| * @param {number} amount | ||
| * @param {number} installmentsNumber | ||
| * @param {number} interestRate | ||
| * @param {boolean} diminishing | ||
| * @param {number} capitalSum | ||
| * @param {number} interestSum | ||
| * | ||
| * @returns {{ capital: number, interest: number, installment: number, remain: number, interestSum: number }} | ||
| * @type {import("../types").GetNextInstalmentFunction} | ||
| */ | ||
| const getNextInstalment = ( | ||
| amount, installmentsNumber, interestRate, diminishing, capitalSum, interestSum | ||
| amount, | ||
| installmentsNumber, | ||
| interestRate, | ||
| diminishing, | ||
| capitalSum, | ||
| interestSum | ||
| ) => { | ||
@@ -55,17 +52,16 @@ let capital | ||
| /** | ||
| * Create Loan Object with all installments and sum of interest | ||
| * | ||
| * @param {number} amount full amount of Loan | ||
| * @param {number} installmentsNumber how many installments will be | ||
| * @param {number} interestRate interest rate in percent (3.5) equal/annuity (false) | ||
| * @param {boolean} diminishing if installments will be diminishing (true) or not | ||
| * | ||
| * @return {object} | ||
| * @type {import('../types').LoanFunction} | ||
| */ | ||
| function Loan (amount, installmentsNumber, interestRate, diminishing = false) { | ||
| /** Checking params */ | ||
| if (!amount || amount <= 0 || | ||
| !installmentsNumber || installmentsNumber <= 0 || | ||
| !interestRate || interestRate <= 0) { | ||
| throw new Error(`wrong parameters: ${amount} ${installmentsNumber} ${interestRate}`) | ||
| if ( | ||
| !amount || | ||
| amount <= 0 || | ||
| !installmentsNumber || | ||
| installmentsNumber <= 0 || | ||
| !interestRate || | ||
| interestRate <= 0 | ||
| ) { | ||
| throw new Error( | ||
| `wrong parameters: ${amount} ${installmentsNumber} ${interestRate}` | ||
| ) | ||
| } | ||
@@ -80,3 +76,8 @@ | ||
| const inst = getNextInstalment( | ||
| amount, installmentsNumber, interestRate, diminishing, capitalSum, interestSum | ||
| amount, | ||
| installmentsNumber, | ||
| interestRate, | ||
| diminishing, | ||
| capitalSum, | ||
| interestSum | ||
| ) | ||
@@ -107,15 +108,11 @@ | ||
| /* istanbul ignore next */ | ||
| if (typeof module === 'undefined') { | ||
| // browser | ||
| if (typeof LOANJS_NAMESPACE === 'object') { | ||
| LOANJS_NAMESPACE.Loan = Loan // eslint-disable-line no-undef | ||
| } else { | ||
| if (!window.LoanJS) { | ||
| window.LoanJS = {} | ||
| } | ||
| window.LoanJS.Loan = Loan | ||
| if (typeof window !== 'undefined') { | ||
| /** @type {any} */ | ||
| const localWindow = window | ||
| if (!localWindow.LoanJS) { | ||
| localWindow.LoanJS = {} | ||
| } | ||
| } else { | ||
| // node or browserfy | ||
| module.exports = Loan | ||
| localWindow.LoanJS.Loan = Loan | ||
| } | ||
| export default Loan |
+3
-1
@@ -41,3 +41,5 @@ /* eslint-env jest */ | ||
| test('loan js should throw on wrong params', () => { | ||
| expect(() => Loan(20000, 'asd')).toThrowError('wrong parameters: 20000 asd undefined') | ||
| /** @type any */ | ||
| const LoanToTest = Loan | ||
| expect(() => LoanToTest(20000, 'asd')).toThrowError('wrong parameters: 20000 asd undefined') | ||
| }) |
+13
-24
| /** | ||
| * Create Loan Object with all installments and sum of interest | ||
| * @param {Loan} loan loan object | ||
| * @param {object} params params | ||
| * | ||
| * @return {string} html string with table | ||
| * @type {import("../types").LoanToHtmlTableFunction} | ||
| */ | ||
| function loanToHtmlTable (loan, params) { | ||
| params = params || {} | ||
| function loanToHtmlTable (loan, params = {}) { | ||
| params.formatMoney = params.formatMoney || function (num) { | ||
@@ -14,8 +9,6 @@ return num.toFixed(2) | ||
| const fm = params.formatMoney | ||
| /** @param {string} key */ | ||
| const trans = function (key) { | ||
| if (params.translations && params.translations[key]) { | ||
| return params.translations[key] | ||
| } else { | ||
| return key | ||
| } | ||
| return params?.translations?.[key] || key | ||
| } | ||
@@ -68,15 +61,11 @@ const html = [ | ||
| /* istanbul ignore next */ | ||
| if (typeof module === 'undefined') { | ||
| // browser | ||
| if (typeof LOANJS_NAMESPACE === 'object') { | ||
| LOANJS_NAMESPACE.loanToHtmlTable = loanToHtmlTable // eslint-disable-line no-undef | ||
| } else { | ||
| if (!window.LoanJS) { | ||
| window.LoanJS = {} | ||
| } | ||
| window.LoanJS.loanToHtmlTable = loanToHtmlTable | ||
| if (typeof window !== 'undefined') { | ||
| /** @type {any} */ | ||
| const localWindow = window | ||
| if (!localWindow.LoanJS) { | ||
| localWindow.LoanJS = {} | ||
| } | ||
| } else { | ||
| // node or browserfy | ||
| module.exports = loanToHtmlTable | ||
| localWindow.LoanJS.loanToHtmlTable = loanToHtmlTable | ||
| } | ||
| export default loanToHtmlTable |
+1
-1
@@ -6,3 +6,3 @@ /* | ||
| * | ||
| * Copyright (c) 2014 Grzegorz Klimek | ||
| * Copyright (c) 2023 Grzegorz Klimek | ||
| * Licensed under the MIT license. | ||
@@ -9,0 +9,0 @@ */ |
+1
-1
@@ -6,3 +6,3 @@ /* | ||
| * | ||
| * Copyright (c) 2014 Grzegorz Klimek | ||
| * Copyright (c) 2023 Grzegorz Klimek | ||
| * Licensed under the MIT license. | ||
@@ -9,0 +9,0 @@ */ |
+12
-4
| { | ||
| "name": "loanjs", | ||
| "version": "1.0.10", | ||
| "version": "1.0.11", | ||
| "main": "LoanJS.js", | ||
@@ -17,2 +17,3 @@ "description": "Calculate loan in js (browser/node.js) for equal installments, installments decreasing, the sum of interest, etc.", | ||
| }, | ||
| "types": "types.d.ts", | ||
| "license": "MIT", | ||
@@ -38,2 +39,4 @@ "files": [ | ||
| "@babel/preset-env": "^7.22.5", | ||
| "@types/jest": "^29.5.2", | ||
| "@types/node": "^20.3.1", | ||
| "babel-jest": "^29.5.0", | ||
@@ -43,2 +46,3 @@ "jest": "~29.5.0", | ||
| "standard": "~17.1.0", | ||
| "typescript": "^5.1.3", | ||
| "uglify-js": "~3.17.4" | ||
@@ -48,10 +52,14 @@ }, | ||
| "test": "npm run lint && npm run test:node && npm run test:cover", | ||
| "test:unit": "jest", | ||
| "test:node": "node ./nodeTest.js", | ||
| "test:cover": "jest --coverage", | ||
| "test:watch": "jest --coverage --watchAll", | ||
| "lint": "standard lib/*.js nodeTest.js", | ||
| "lint": "npm run lint:standard && npm run lint:tsc", | ||
| "lint:standard": "standard lib/*.js nodeTest.js", | ||
| "lint:tsc": "tsc --noEmit", | ||
| "fix": "npm run lint:standard -- --fix", | ||
| "clean": "rm -rf dist coverage", | ||
| "build": "npm run clean && npm run build:loan && npm run build:loanToHtml && npm run min", | ||
| "build:loan": "rollup lib/loan.js --name loan --format iife --file dist/loan.js && babel -o dist/loan.js dist/loan.js", | ||
| "build:loanToHtml": "rollup lib/loanToHtmlTable.js --name loanToHtmlTable --format iife --file dist/loanToHtmlTable.js && babel -o dist/loanToHtmlTable.js dist/loanToHtmlTable.js", | ||
| "build:loan": "rollup lib/loan.js --name loan --format umd --file dist/loan.js && babel -o dist/loan.js dist/loan.js", | ||
| "build:loanToHtml": "rollup lib/loanToHtmlTable.js --name loanToHtmlTable --format umd --file dist/loanToHtmlTable.js && babel -o dist/loanToHtmlTable.js dist/loanToHtmlTable.js", | ||
| "min": "npm run min:loan && npm run min:loanToHtml", | ||
@@ -58,0 +66,0 @@ "min:loan": "uglifyjs dist/loan.js -c -m -o dist/loan.min.js", |
+18
-8
@@ -7,4 +7,6 @@ # LoanJS | ||
| > Super **small** (**~500B**) and **fast** module to calculate loan in js (browser/node.js) for **equal**/**decreasing** installments, the **sum of interest**, etc. | ||
| Super **small** (**~500B**) and **fast** module to calculate loan in js (browser/node.js) for **equal**/**decreasing** installments, the **sum of interest**, etc. | ||
| Now with TypeScript support | ||
| ## Getting Started | ||
@@ -24,4 +26,7 @@ | ||
| ```js | ||
| var LoanJS = require('loanjs'); | ||
| var loan = new LoanJS.Loan( | ||
| import { Loan } from 'loanjs'; | ||
| // or | ||
| const { Loan } = require('loanjs'); | ||
| const loan = new Loan( | ||
| 1000, // amount | ||
@@ -86,8 +91,8 @@ 12, // installments number | ||
| var Loan = require('loanjs').Loan; | ||
| const { Loan } = require('loanjs'); | ||
| var loan_1 = new Loan(1000, 12, 5, true); | ||
| const loan_1 = new Loan(1000, 12, 5, true); | ||
| // loan on 1 000($) in 12 diminishing installments (ex. months) with 5% interest rate | ||
| var loan_2 = new Loan(500000, 360, 3.5); | ||
| const loan_2 = new Loan(500000, 360, 3.5); | ||
| // loan on 500 000($) in 360 equal installments (30 years) with 3.5% interest rate | ||
@@ -118,3 +123,3 @@ ``` | ||
| Im open to contributors :). | ||
| Im open for contributors :). | ||
@@ -124,2 +129,7 @@ | ||
| #### 2023-06-23 v1.0.11 | ||
| * add TypeScript types | ||
| * code cleanup | ||
| * packages update | ||
| #### 2017-08-06 v1.0.0 | ||
@@ -147,3 +157,3 @@ * go to es6 | ||
| Copyright (c) 2014 Grzegorz Klimek | ||
| Copyright (c) 2023 Grzegorz Klimek | ||
| Licensed under the MIT license. |
154
6.94%25643
-2.74%11
37.5%489
-7.74%