sehoo 1.0.5 → 1.0.6
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/index.ts +21 -8
- package/lib/index.d.ts +2 -17
- package/lib/index.js +0 -7
- package/package.json +1 -1
package/index.ts
CHANGED
@@ -13,6 +13,26 @@ type Option = {
|
|
13
13
|
returnInKorean?: boolean; // 반환 값에 한글 사용 여부
|
14
14
|
};
|
15
15
|
|
16
|
+
type Result = {
|
17
|
+
국민연금: number,
|
18
|
+
건강보험: number,
|
19
|
+
장기요양보험: number,
|
20
|
+
고용보험: number,
|
21
|
+
소득세: number,
|
22
|
+
주민세: number,
|
23
|
+
공제액_합계: number,
|
24
|
+
실수령액: number;
|
25
|
+
} | {
|
26
|
+
pension: number
|
27
|
+
healthcare: number
|
28
|
+
longTermCareInsurance: number
|
29
|
+
employmentInsuranc: number
|
30
|
+
incomeTax: number
|
31
|
+
inhabitantsTax: number
|
32
|
+
total: number
|
33
|
+
actualSalary: number
|
34
|
+
}
|
35
|
+
|
16
36
|
const validateParams = (option: Option) => {
|
17
37
|
if (typeof option.monthlyPaycheck !== 'number' ) {
|
18
38
|
throw new Error("월 급여는 number 타입이어야 합니다.");
|
@@ -36,7 +56,7 @@ const validateParams = (option: Option) => {
|
|
36
56
|
}
|
37
57
|
};
|
38
58
|
|
39
|
-
const sehoo = (option: Option) => {
|
59
|
+
const sehoo = (option: Option): Result => {
|
40
60
|
validateParams(option);
|
41
61
|
const 세전_월급여 = option.monthlyPaycheck;
|
42
62
|
const 비과세액 = option.taxFreeAmount || 1;
|
@@ -101,12 +121,5 @@ const sehoo = (option: Option) => {
|
|
101
121
|
actualSalary: 세전_월급여 - 공제액_합계,
|
102
122
|
};
|
103
123
|
};
|
104
|
-
// main({
|
105
|
-
// monthlyPaycheck: 6_290_000,
|
106
|
-
// taxFreeAmount: 100_000,
|
107
|
-
// numberOfFamily: 1,
|
108
|
-
// smallBusinessTaxReduction: true,
|
109
|
-
// })
|
110
|
-
// .then(console.log)
|
111
124
|
|
112
125
|
export default sehoo;
|
package/lib/index.d.ts
CHANGED
@@ -5,7 +5,7 @@ type Option = {
|
|
5
5
|
smallBusinessTaxReduction?: boolean;
|
6
6
|
returnInKorean?: boolean;
|
7
7
|
};
|
8
|
-
|
8
|
+
type Result = {
|
9
9
|
국민연금: number;
|
10
10
|
건강보험: number;
|
11
11
|
장기요양보험: number;
|
@@ -14,14 +14,6 @@ declare const sehoo: (option: Option) => {
|
|
14
14
|
주민세: number;
|
15
15
|
공제액_합계: number;
|
16
16
|
실수령액: number;
|
17
|
-
pension?: undefined;
|
18
|
-
healthcare?: undefined;
|
19
|
-
longTermCareInsurance?: undefined;
|
20
|
-
employmentInsuranc?: undefined;
|
21
|
-
incomeTax?: undefined;
|
22
|
-
inhabitantsTax?: undefined;
|
23
|
-
total?: undefined;
|
24
|
-
actualSalary?: undefined;
|
25
17
|
} | {
|
26
18
|
pension: number;
|
27
19
|
healthcare: number;
|
@@ -31,13 +23,6 @@ declare const sehoo: (option: Option) => {
|
|
31
23
|
inhabitantsTax: number;
|
32
24
|
total: number;
|
33
25
|
actualSalary: number;
|
34
|
-
국민연금?: undefined;
|
35
|
-
건강보험?: undefined;
|
36
|
-
장기요양보험?: undefined;
|
37
|
-
고용보험?: undefined;
|
38
|
-
소득세?: undefined;
|
39
|
-
주민세?: undefined;
|
40
|
-
공제액_합계?: undefined;
|
41
|
-
실수령액?: undefined;
|
42
26
|
};
|
27
|
+
declare const sehoo: (option: Option) => Result;
|
43
28
|
export default sehoo;
|
package/lib/index.js
CHANGED
@@ -94,11 +94,4 @@ const sehoo = (option) => {
|
|
94
94
|
actualSalary: 세전_월급여 - 공제액_합계,
|
95
95
|
};
|
96
96
|
};
|
97
|
-
// main({
|
98
|
-
// monthlyPaycheck: 6_290_000,
|
99
|
-
// taxFreeAmount: 100_000,
|
100
|
-
// numberOfFamily: 1,
|
101
|
-
// smallBusinessTaxReduction: true,
|
102
|
-
// })
|
103
|
-
// .then(console.log)
|
104
97
|
exports.default = sehoo;
|