social-security-calculator 0.0.6 → 0.0.8
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.txt +13 -0
- package/README.md +5 -8
- package/lib/estimatedEarnings/index.js +45 -0
- package/lib/index.js +107 -36
- package/lib/model.js +1 -0
- package/lib/parseStatement/index.js +19 -0
- package/lib/wage-index.js +87 -49
- package/package.json +22 -5
- package/lib/index.d.ts +0 -15
- package/lib/package.bak +0 -31
package/LICENSE.txt
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
Copyright 2022 RYAN ANTKOWIAK, CHARLES MCNULTY
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation
|
|
4
|
+
files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy,
|
|
5
|
+
modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the
|
|
6
|
+
Software is furnished to do so, subject to the following conditions:
|
|
7
|
+
|
|
8
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
9
|
+
|
|
10
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
|
|
11
|
+
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
|
|
12
|
+
OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
|
|
13
|
+
OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
CHANGED
|
@@ -4,14 +4,11 @@ TypeScript to calculate estimated Social Security Benefits
|
|
|
4
4
|
|
|
5
5
|
This module will calculate your expected retirement benefits
|
|
6
6
|
from Social Security given your annual earnings
|
|
7
|
-
Inputs:
|
|
8
|
-
1) EarningsRecord -
|
|
9
|
-
Dictionary mapping a year to the amount of Social
|
|
10
|
-
Security eligible earnings in that particular year
|
|
11
7
|
|
|
12
|
-
|
|
13
|
-
Data pulled directly from the Social Security website for the
|
|
14
|
-
national average wage data
|
|
8
|
+
Input:
|
|
15
9
|
|
|
16
|
-
|
|
10
|
+
Dictionary mapping a year to the amount of Social
|
|
11
|
+
Security eligible earnings in that particular year
|
|
17
12
|
|
|
13
|
+
|
|
14
|
+
Adapted from python originally written by Ryan Antkowiak
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { wageIndex, quickCalcProjections, taxableMaximum } from '../wage-index';
|
|
2
|
+
const YOUTH_FACTOR = 8;
|
|
3
|
+
const YOUTH_FACTOR_AGE = 21;
|
|
4
|
+
const WORK_START_AGE = 18;
|
|
5
|
+
const CURRENT_YEAR = new Date().getFullYear();
|
|
6
|
+
export function getEstimatedEarnings(age, lastWage, lastYearWorked = CURRENT_YEAR, earningGrowthRate = 0) {
|
|
7
|
+
if (age <= 22) {
|
|
8
|
+
throw new Error('Age must be greater than 22');
|
|
9
|
+
}
|
|
10
|
+
if (lastYearWorked > CURRENT_YEAR) {
|
|
11
|
+
throw new Error('Last year worked cannot be in the future');
|
|
12
|
+
}
|
|
13
|
+
const workStartYear = CURRENT_YEAR - age + WORK_START_AGE;
|
|
14
|
+
const yearTurned22 = CURRENT_YEAR - age + YOUTH_FACTOR_AGE;
|
|
15
|
+
const wageResults = {};
|
|
16
|
+
for (let i = lastYearWorked; i >= workStartYear; i--) {
|
|
17
|
+
const year = i;
|
|
18
|
+
const nextYear = (i + 1);
|
|
19
|
+
const youthAdjustment = (i === yearTurned22 ? YOUTH_FACTOR : 1);
|
|
20
|
+
wageResults[year] = (i === lastYearWorked)
|
|
21
|
+
? lastWage
|
|
22
|
+
: wageResults[nextYear] * getReductionFactor(i) / (1 + earningGrowthRate) / youthAdjustment;
|
|
23
|
+
}
|
|
24
|
+
// Cap wages at taxable maximum
|
|
25
|
+
Object.keys(wageResults).forEach(strYear => {
|
|
26
|
+
const year = parseInt(strYear);
|
|
27
|
+
const maxTaxable = taxableMaximum[year];
|
|
28
|
+
wageResults[year] = Math.min(wageResults[year], maxTaxable);
|
|
29
|
+
});
|
|
30
|
+
return wageResults;
|
|
31
|
+
}
|
|
32
|
+
function getReductionFactor(year) {
|
|
33
|
+
const allIndexes = Object.assign(Object.assign({}, wageIndex), quickCalcProjections);
|
|
34
|
+
const lastYear = year - 1;
|
|
35
|
+
const nextYear = year + 1;
|
|
36
|
+
if (year === CURRENT_YEAR && !allIndexes[lastYear]) {
|
|
37
|
+
throw new Error(`Wage index for previous year (${lastYear}) is required`);
|
|
38
|
+
}
|
|
39
|
+
if (year === CURRENT_YEAR) {
|
|
40
|
+
return 1;
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
return (allIndexes[year] / allIndexes[nextYear]);
|
|
44
|
+
}
|
|
45
|
+
}
|
package/lib/index.js
CHANGED
|
@@ -1,49 +1,120 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { wageIndex } from './wage-index';
|
|
2
|
+
export function calc(birthday, retirementDate, earnings) {
|
|
3
|
+
const AIME = calculateAIME(earnings);
|
|
4
|
+
const results = calcRetirementBenefit(birthday, retirementDate, AIME);
|
|
5
|
+
return results;
|
|
6
|
+
}
|
|
7
|
+
export function calcRetirementBenefit(birthday, retirementDate, AIME) {
|
|
8
|
+
const eclBirthDate = getEnglishCommonLawDate(birthday);
|
|
9
|
+
const fullRetirementMonths = getFullRetirementMonths(eclBirthDate);
|
|
10
|
+
const PIA = calculatePIA(AIME);
|
|
11
|
+
const benefitAt62 = calculateSocialSecurityReduction(PIA, 60);
|
|
12
|
+
const normalMonthlyBenefit = Math.floor(PIA);
|
|
13
|
+
const results = {
|
|
14
|
+
"AIME": AIME,
|
|
15
|
+
"NormalMonthlyBenefit": normalMonthlyBenefit,
|
|
16
|
+
"NormalAnnualBenefit": PIA * 12,
|
|
17
|
+
"ReducedMonthlyBenefit": benefitAt62,
|
|
18
|
+
"ReducedAnnualBenefit": benefitAt62 * 12,
|
|
19
|
+
};
|
|
20
|
+
return results;
|
|
21
|
+
}
|
|
22
|
+
function calculatePIA(AIME) {
|
|
23
|
+
const averageWageLastYear = Math.max(...Object.keys(wageIndex).map(val => parseInt(val)));
|
|
24
|
+
const wageIndexLastYear = wageIndex[averageWageLastYear];
|
|
7
25
|
const bendPointDivisor = 9779.44;
|
|
8
|
-
const firstBendPointMultiplier = 180
|
|
9
|
-
const secondBendPointMultiplier = 1085
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
.slice(0, lookbackYears) // grab the highest 35 earnings years
|
|
18
|
-
.reduce((partialSum, a) => partialSum + a, 0); // and finally sum them
|
|
19
|
-
const AIME = top35YearsEarnings / (12 * lookbackYears);
|
|
20
|
-
const normalMonthlyBenefit = (() => {
|
|
26
|
+
const firstBendPointMultiplier = 180;
|
|
27
|
+
const secondBendPointMultiplier = 1085;
|
|
28
|
+
// https://www.ssa.gov/oact/COLA/piaformula.html
|
|
29
|
+
// Per examples, bend points are rounded to the nearest dollar
|
|
30
|
+
const firstBendPoint = Math.round(firstBendPointMultiplier * wageIndexLastYear / bendPointDivisor);
|
|
31
|
+
const secondBendPoint = Math.round(secondBendPointMultiplier * wageIndexLastYear / bendPointDivisor);
|
|
32
|
+
// https://www.ssa.gov/OP_Home/handbook/handbook.07/handbook-0738.html
|
|
33
|
+
// Calculations that are not a multiple of 10 cents are rounded to the next lower multiple of 10 cents. For example, $100.18 is rounded down to $100.10.
|
|
34
|
+
const PIA = (() => {
|
|
21
35
|
let monthlyBenefit = 0;
|
|
22
36
|
if (AIME <= firstBendPoint) {
|
|
23
37
|
monthlyBenefit = 0.9 * AIME;
|
|
24
38
|
}
|
|
25
39
|
else {
|
|
26
40
|
if (AIME > firstBendPoint && AIME <= secondBendPoint) {
|
|
27
|
-
monthlyBenefit = 0.9 * firstBendPoint + 0.32 * (AIME - firstBendPoint);
|
|
41
|
+
monthlyBenefit = (0.9 * firstBendPoint) + (0.32 * (AIME - firstBendPoint));
|
|
28
42
|
}
|
|
29
43
|
else {
|
|
30
|
-
monthlyBenefit = 0.9 * firstBendPoint + 0.32 * (secondBendPoint - firstBendPoint) + 0.15 * (AIME - secondBendPoint);
|
|
44
|
+
monthlyBenefit = (0.9 * firstBendPoint) + (0.32 * (secondBendPoint - firstBendPoint)) + (0.15 * (AIME - secondBendPoint));
|
|
31
45
|
}
|
|
32
46
|
}
|
|
33
|
-
return
|
|
34
|
-
;
|
|
47
|
+
return roundToFloorTenCents(monthlyBenefit);
|
|
35
48
|
})();
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
49
|
+
return PIA;
|
|
50
|
+
}
|
|
51
|
+
function calculateAIME(earnings) {
|
|
52
|
+
const lookbackYears = 35;
|
|
53
|
+
const averageWageLastYear = Math.max(...Object.keys(wageIndex).map(val => parseInt(val)));
|
|
54
|
+
const wageIndexLastYear = wageIndex[averageWageLastYear];
|
|
55
|
+
const futureYearsFactor = 1;
|
|
56
|
+
// calculate the wage index factors
|
|
57
|
+
const wageIndexFactors = Object.entries(wageIndex).reduce((acc, [i, val]) => ((acc[parseInt(i)] = 1 + (wageIndexLastYear - val) / val), acc), {});
|
|
58
|
+
// adjust the earnings according to the wage index factor,
|
|
59
|
+
// factor is 1 for any earnings record without a wage-factor
|
|
60
|
+
const adjustedEarnings = Object.entries(earnings).reduce((acc, [i, val]) => ((acc[parseInt(i)] = val * (wageIndexFactors[parseInt(i)] || futureYearsFactor)), acc), {});
|
|
61
|
+
const top35YearsEarningsArr = Object.values(adjustedEarnings)
|
|
62
|
+
.sort((a, b) => b - a) // sort the earnings from highest to lowest amount
|
|
63
|
+
.slice(0, lookbackYears); // grab the highest 35 earnings years
|
|
64
|
+
const top35YearsEarnings = top35YearsEarningsArr.reduce((partialSum, a) => partialSum + a, 0); // and finally sum them
|
|
65
|
+
// https://www.ssa.gov/oact/cola/Benefits.html
|
|
66
|
+
// "We then round the resulting average amount down to the next lower dollar amount"
|
|
67
|
+
const AIME = Math.floor(top35YearsEarnings / (12 * lookbackYears));
|
|
68
|
+
return AIME;
|
|
69
|
+
}
|
|
70
|
+
function calculateSocialSecurityReduction(amount, months) {
|
|
71
|
+
const first36Rate = 5 / 9 * 0.01; // 5/9 of 1%
|
|
72
|
+
const additionalRate = 5 / 12 * 0.01; // 5/12 of 1%
|
|
73
|
+
let reduction = 0;
|
|
74
|
+
if (months <= 36) {
|
|
75
|
+
reduction = months * first36Rate;
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
// 36 months times 5/9 of 1 percent plus 24 months times 5/12 of 1 percent.
|
|
79
|
+
reduction = 36 * first36Rate + (months - 36) * additionalRate;
|
|
80
|
+
}
|
|
81
|
+
return amount - amount * reduction;
|
|
82
|
+
}
|
|
83
|
+
function roundToFloorTenCents(amount) {
|
|
84
|
+
// Convert the amount to fractional dimes
|
|
85
|
+
let dimes = amount * 10;
|
|
86
|
+
// floor to only whole dimes
|
|
87
|
+
dimes = Math.floor(dimes);
|
|
88
|
+
// Convert back to dollars and return
|
|
89
|
+
return (dimes / 10);
|
|
90
|
+
}
|
|
91
|
+
function getEnglishCommonLawDate(date) {
|
|
92
|
+
const year = date.getFullYear();
|
|
93
|
+
const month = date.getMonth();
|
|
94
|
+
const day = date.getDate();
|
|
95
|
+
const englishCommonLawDate = new Date(year, month, day - 1);
|
|
96
|
+
return englishCommonLawDate;
|
|
97
|
+
}
|
|
98
|
+
export function getFullRetirementMonths(commonLawBirthDate) {
|
|
99
|
+
const year = commonLawBirthDate.getFullYear();
|
|
100
|
+
switch (true) {
|
|
101
|
+
case (year >= 1943 && year <= 1954):
|
|
102
|
+
return 66 * 12;
|
|
103
|
+
case (year >= 1955 && year <= 1959):
|
|
104
|
+
const fra = ((year - 1954) * 2) + (66 * 12);
|
|
105
|
+
return fra;
|
|
106
|
+
case (year >= 1960):
|
|
107
|
+
return 67 * 12;
|
|
108
|
+
default:
|
|
109
|
+
throw new Error('Invalid birth year');
|
|
110
|
+
}
|
|
48
111
|
}
|
|
49
|
-
|
|
112
|
+
/*
|
|
113
|
+
1943-1954 66 48 $750 25.00% $350 30.00%
|
|
114
|
+
1955 66 and 2 months 50 $741 25.83% $345 30.83%
|
|
115
|
+
1956 66 and 4 months 52 $733 26.67% $341 31.67%
|
|
116
|
+
1957 66 and 6 months 54 $725 27.50% $337 32.50%
|
|
117
|
+
1958 66 and 8 months 56 $716 28.33% $333 33.33%
|
|
118
|
+
1959 66 and 10 months 58 $708 29.17% $329 34.17%
|
|
119
|
+
1960+ 67 60 $700 30.00% $325 35.00%
|
|
120
|
+
*/
|
package/lib/model.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import xml2js from 'xml2js';
|
|
2
|
+
import fs from 'fs/promises';
|
|
3
|
+
const NS = 'OSSS';
|
|
4
|
+
// strict false because attribute is unquoted: <osss:OnlineSocialSecurityStatementData xmlns:osss=http://ssa.gov/osss/schemas/2.0>
|
|
5
|
+
// could fix the XML, but better to keep file unchanged so that we can drop in relacement files from SSA
|
|
6
|
+
const parser = new xml2js.Parser({ strict: false });
|
|
7
|
+
const supportedVersion = "http://ssa.gov/osss/schemas/2.0";
|
|
8
|
+
async function getWages(fileName) {
|
|
9
|
+
const data = await fs.readFile(fileName);
|
|
10
|
+
const result = await parser.parseStringPromise(data);
|
|
11
|
+
const schema = result[`${NS}:ONLINESOCIALSECURITYSTATEMENTDATA`]['$'][`XMLNS:${NS}`];
|
|
12
|
+
if (schema !== supportedVersion) {
|
|
13
|
+
throw `${schema} is not supported (${supportedVersion})`;
|
|
14
|
+
}
|
|
15
|
+
const results = result[`${NS}:ONLINESOCIALSECURITYSTATEMENTDATA`][`${NS}:EARNINGSRECORD`][0][`${NS}:EARNINGS`];
|
|
16
|
+
const earnings = results.reduce((acc, earn) => (earn[`${NS}:FICAEARNINGS`][0] === '-1' ? acc : acc[earn['$'].STARTYEAR] = parseInt(earn[`${NS}:FICAEARNINGS`][0]), acc), {});
|
|
17
|
+
return earnings;
|
|
18
|
+
}
|
|
19
|
+
export default getWages;
|
package/lib/wage-index.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.wageIndex = void 0;
|
|
4
|
-
const compound = require('compound-calc');
|
|
5
|
-
exports.wageIndex = {
|
|
1
|
+
// https://www.ssa.gov/OACT/COLA/awiseries.html
|
|
2
|
+
export const wageIndex = {
|
|
6
3
|
1951: 2799.16,
|
|
7
4
|
1952: 2973.32,
|
|
8
5
|
1953: 3139.44,
|
|
@@ -73,50 +70,91 @@ exports.wageIndex = {
|
|
|
73
70
|
2018: 52145.8,
|
|
74
71
|
2019: 54099.99,
|
|
75
72
|
2020: 55628.6,
|
|
73
|
+
2021: 60575.07,
|
|
74
|
+
2022: 63795.13
|
|
76
75
|
};
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
76
|
+
// retrieved from: view-source:https://www.ssa.gov/cgi-bin/benefit6.cgi
|
|
77
|
+
export const quickCalcProjections = {
|
|
78
|
+
2023: 66488.13,
|
|
79
|
+
2024: 68981.33,
|
|
80
|
+
2025: 71780.09,
|
|
81
|
+
2026: 74731.71,
|
|
82
|
+
2027: 77792.60,
|
|
83
|
+
2028: 80925.73,
|
|
84
|
+
2029: 84188.76,
|
|
85
|
+
2030: 87555.49,
|
|
86
|
+
2031: 91041.35,
|
|
87
|
+
2032: 94479.84,
|
|
88
|
+
2033: 97957.36,
|
|
89
|
+
2034: 101547.32,
|
|
90
|
+
2035: 105266.09,
|
|
91
|
+
2036: 109120.74,
|
|
92
|
+
2037: 113117.42,
|
|
93
|
+
2038: 117250.70,
|
|
94
|
+
2039: 121537.41,
|
|
95
|
+
2040: 125958.59,
|
|
96
|
+
2041: 130512.20,
|
|
97
|
+
2042: 135207.00,
|
|
98
|
+
2043: 140051.90,
|
|
99
|
+
2044: 145045.39,
|
|
100
|
+
2045: 150193.68,
|
|
101
|
+
2046: 155501.36,
|
|
102
|
+
2047: 160999.09,
|
|
103
|
+
2048: 166686.37,
|
|
104
|
+
2049: 172576.11,
|
|
89
105
|
};
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
106
|
+
export const taxableMaximum = {
|
|
107
|
+
1972: 9000,
|
|
108
|
+
1973: 10800,
|
|
109
|
+
1974: 13200,
|
|
110
|
+
1975: 14100,
|
|
111
|
+
1976: 15300,
|
|
112
|
+
1977: 16500,
|
|
113
|
+
1978: 17700,
|
|
114
|
+
1979: 22900,
|
|
115
|
+
1980: 25900,
|
|
116
|
+
1981: 29700,
|
|
117
|
+
1982: 32400,
|
|
118
|
+
1983: 35700,
|
|
119
|
+
1984: 37800,
|
|
120
|
+
1985: 39600,
|
|
121
|
+
1986: 42000,
|
|
122
|
+
1987: 43800,
|
|
123
|
+
1988: 45000,
|
|
124
|
+
1989: 48000,
|
|
125
|
+
1990: 51300,
|
|
126
|
+
1991: 53400,
|
|
127
|
+
1992: 55500,
|
|
128
|
+
1993: 57600,
|
|
129
|
+
1994: 60600,
|
|
130
|
+
1995: 61200,
|
|
131
|
+
1996: 62700,
|
|
132
|
+
1997: 65400,
|
|
133
|
+
1998: 68400,
|
|
134
|
+
1999: 72600,
|
|
135
|
+
2000: 76200,
|
|
136
|
+
2001: 80400,
|
|
137
|
+
2002: 84900,
|
|
138
|
+
2003: 87000,
|
|
139
|
+
2004: 87900,
|
|
140
|
+
2005: 90000,
|
|
141
|
+
2006: 94200,
|
|
142
|
+
2007: 97500,
|
|
143
|
+
2008: 102000,
|
|
144
|
+
2009: 106800,
|
|
145
|
+
2010: 106800,
|
|
146
|
+
2011: 106800,
|
|
147
|
+
2012: 110100,
|
|
148
|
+
2013: 113700,
|
|
149
|
+
2014: 117000,
|
|
150
|
+
2015: 118500,
|
|
151
|
+
2016: 118500,
|
|
152
|
+
2017: 127200,
|
|
153
|
+
2018: 128400,
|
|
154
|
+
2019: 132900,
|
|
155
|
+
2020: 137700,
|
|
156
|
+
2021: 142800,
|
|
157
|
+
2022: 147000,
|
|
158
|
+
2023: 160200,
|
|
159
|
+
2024: 168600,
|
|
105
160
|
};
|
|
106
|
-
const fillBlanks = (vals) => Object.entries(vals).reduce((acc, [year, P], index, arr) => {
|
|
107
|
-
let thing;
|
|
108
|
-
if (arr[index + 1]) {
|
|
109
|
-
const [nextYear, A] = arr[index + 1];
|
|
110
|
-
const t = parseInt(nextYear) - parseInt(year);
|
|
111
|
-
const r = Math.pow((A / P), (1 / t)) - 1;
|
|
112
|
-
const vals = compound(P, 0, t, r).result.slice(0, -1);
|
|
113
|
-
const ret = vals.reduce((accx, cur, i) => ((accx[(parseInt(year) + i).toString()] = cur) && accx), {});
|
|
114
|
-
thing = Object.assign(Object.assign({}, acc), ret);
|
|
115
|
-
}
|
|
116
|
-
else {
|
|
117
|
-
thing = Object.assign(Object.assign({}, acc), { [year]: P });
|
|
118
|
-
}
|
|
119
|
-
return thing;
|
|
120
|
-
}, {});
|
|
121
|
-
// console.log(fillBlanks(longRangeIntermediate));
|
|
122
|
-
console.log(fillBlanks({ 2000: 38915, 2021: 108494 }));
|
package/package.json
CHANGED
|
@@ -1,29 +1,46 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "social-security-calculator",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8",
|
|
4
4
|
"description": "Calculate estimated Social Security Benefits",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": "./lib/index.js",
|
|
10
|
+
"./parseStatement": "./lib/parseStatement/index.js",
|
|
11
|
+
"./estimatedEarnings": "./lib/estimatedEarnings/index.js"
|
|
12
|
+
},
|
|
7
13
|
"scripts": {
|
|
8
|
-
"test": "
|
|
14
|
+
"test": "NODE_OPTIONS='--experimental-vm-modules' jest",
|
|
9
15
|
"build": "tsc"
|
|
10
16
|
},
|
|
11
17
|
"repository": {
|
|
12
18
|
"type": "git",
|
|
13
19
|
"url": "git+https://github.com/cmcnulty/SocialSecurityCalculator.git"
|
|
14
20
|
},
|
|
15
|
-
"keywords": [
|
|
21
|
+
"keywords": [
|
|
22
|
+
"calculator",
|
|
23
|
+
"social",
|
|
24
|
+
"security",
|
|
25
|
+
"ssi"
|
|
26
|
+
],
|
|
16
27
|
"author": "",
|
|
17
|
-
"license": "
|
|
28
|
+
"license": "MIT",
|
|
18
29
|
"bugs": {
|
|
19
30
|
"url": "https://github.com/cmcnulty/SocialSecurityCalculator/issues"
|
|
20
31
|
},
|
|
21
32
|
"homepage": "https://github.com/cmcnulty/SocialSecurityCalculator#readme",
|
|
22
33
|
"devDependencies": {
|
|
34
|
+
"@jest/globals": "^29.7.0",
|
|
35
|
+
"@types/jest": "^29.5.8",
|
|
36
|
+
"@types/xml2js": "^0.4.11",
|
|
37
|
+
"compound-calc": "^4.0.3",
|
|
38
|
+
"jest": "^29.7.0",
|
|
39
|
+
"ts-jest": "^29.1.1",
|
|
23
40
|
"typescript": "^4.8.3"
|
|
24
41
|
},
|
|
25
42
|
"dependencies": {
|
|
26
|
-
"
|
|
43
|
+
"xml2js": "^0.6.2"
|
|
27
44
|
},
|
|
28
45
|
"files": [
|
|
29
46
|
"lib"
|
package/lib/index.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export = calc;
|
|
2
|
-
declare function calc(earnings: any): {
|
|
3
|
-
Top35YearsEarnings: any;
|
|
4
|
-
AIME: string;
|
|
5
|
-
FirstBendPoint: string;
|
|
6
|
-
SecondBendPoint: string;
|
|
7
|
-
NormalMonthlyBenefit: string;
|
|
8
|
-
NormalAnnualBenefit: string;
|
|
9
|
-
ReducedMonthlyBenefit: string;
|
|
10
|
-
ReducedAnnualBenefit: string;
|
|
11
|
-
};
|
|
12
|
-
declare namespace calc {
|
|
13
|
-
export { __esModule };
|
|
14
|
-
}
|
|
15
|
-
declare const __esModule: boolean;
|
package/lib/package.bak
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "social-security-calculator",
|
|
3
|
-
"version": "0.0.5",
|
|
4
|
-
"description": "Calculate estimated Social Security Benefits",
|
|
5
|
-
"main": "index.js",
|
|
6
|
-
"types": "index.d.ts",
|
|
7
|
-
"files": [
|
|
8
|
-
"**/*"
|
|
9
|
-
],
|
|
10
|
-
"scripts": {
|
|
11
|
-
"test": "echo \"Error: no test specified\" && exit 1",
|
|
12
|
-
"build": "tsc"
|
|
13
|
-
},
|
|
14
|
-
"repository": {
|
|
15
|
-
"type": "git",
|
|
16
|
-
"url": "git+https://github.com/cmcnulty/SocialSecurityCalculator.git"
|
|
17
|
-
},
|
|
18
|
-
"keywords": [],
|
|
19
|
-
"author": "",
|
|
20
|
-
"license": "ISC",
|
|
21
|
-
"bugs": {
|
|
22
|
-
"url": "https://github.com/cmcnulty/SocialSecurityCalculator/issues"
|
|
23
|
-
},
|
|
24
|
-
"homepage": "https://github.com/cmcnulty/SocialSecurityCalculator#readme",
|
|
25
|
-
"devDependencies": {
|
|
26
|
-
"typescript": "^4.8.3"
|
|
27
|
-
},
|
|
28
|
-
"dependencies": {
|
|
29
|
-
"compound-calc": "^2.0.0"
|
|
30
|
-
}
|
|
31
|
-
}
|