sehoo 1.0.4 → 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 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 = async (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 = async (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
- declare const sehoo: (option: Option) => Promise<{
8
+ type Result = {
9
9
  국민연금: number;
10
10
  건강보험: number;
11
11
  장기요양보험: number;
@@ -14,14 +14,6 @@ declare const sehoo: (option: Option) => Promise<{
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) => Promise<{
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
@@ -1,13 +1,4 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
2
  Object.defineProperty(exports, "__esModule", { value: true });
12
3
  const fs = require("fs");
13
4
  const path = require("path");
@@ -34,7 +25,7 @@ const validateParams = (option) => {
34
25
  throw new Error("공제대상 가족 수는 1 이상 11 이하이어야 합니다.");
35
26
  }
36
27
  };
37
- const sehoo = (option) => __awaiter(void 0, void 0, void 0, function* () {
28
+ const sehoo = (option) => {
38
29
  var _a;
39
30
  validateParams(option);
40
31
  const 세전_월급여 = option.monthlyPaycheck;
@@ -102,12 +93,5 @@ const sehoo = (option) => __awaiter(void 0, void 0, void 0, function* () {
102
93
  total: 공제액_합계,
103
94
  actualSalary: 세전_월급여 - 공제액_합계,
104
95
  };
105
- });
106
- // main({
107
- // monthlyPaycheck: 6_290_000,
108
- // taxFreeAmount: 100_000,
109
- // numberOfFamily: 1,
110
- // smallBusinessTaxReduction: true,
111
- // })
112
- // .then(console.log)
96
+ };
113
97
  exports.default = sehoo;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sehoo",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "scripts": {