jell-utils 0.1.0 → 0.2.0
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/.claude/commands/tm/add-dependency.md +58 -0
- package/.claude/commands/tm/add-subtask.md +79 -0
- package/.claude/commands/tm/add-task.md +81 -0
- package/.claude/commands/tm/analyze-complexity.md +124 -0
- package/.claude/commands/tm/analyze-project.md +100 -0
- package/.claude/commands/tm/auto-implement-tasks.md +100 -0
- package/.claude/commands/tm/command-pipeline.md +80 -0
- package/.claude/commands/tm/complexity-report.md +120 -0
- package/.claude/commands/tm/convert-task-to-subtask.md +74 -0
- package/.claude/commands/tm/expand-all-tasks.md +52 -0
- package/.claude/commands/tm/expand-task.md +52 -0
- package/.claude/commands/tm/fix-dependencies.md +82 -0
- package/.claude/commands/tm/help.md +101 -0
- package/.claude/commands/tm/init-project-quick.md +49 -0
- package/.claude/commands/tm/init-project.md +53 -0
- package/.claude/commands/tm/install-taskmaster.md +118 -0
- package/.claude/commands/tm/learn.md +106 -0
- package/.claude/commands/tm/list-tasks-by-status.md +42 -0
- package/.claude/commands/tm/list-tasks-with-subtasks.md +30 -0
- package/.claude/commands/tm/list-tasks.md +46 -0
- package/.claude/commands/tm/next-task.md +69 -0
- package/.claude/commands/tm/parse-prd-with-research.md +51 -0
- package/.claude/commands/tm/parse-prd.md +52 -0
- package/.claude/commands/tm/project-status.md +67 -0
- package/.claude/commands/tm/quick-install-taskmaster.md +23 -0
- package/.claude/commands/tm/remove-all-subtasks.md +94 -0
- package/.claude/commands/tm/remove-dependency.md +65 -0
- package/.claude/commands/tm/remove-subtask.md +87 -0
- package/.claude/commands/tm/remove-subtasks.md +89 -0
- package/.claude/commands/tm/remove-task.md +110 -0
- package/.claude/commands/tm/setup-models.md +52 -0
- package/.claude/commands/tm/show-task.md +85 -0
- package/.claude/commands/tm/smart-workflow.md +58 -0
- package/.claude/commands/tm/sync-readme.md +120 -0
- package/.claude/commands/tm/tm-main.md +147 -0
- package/.claude/commands/tm/to-cancelled.md +58 -0
- package/.claude/commands/tm/to-deferred.md +50 -0
- package/.claude/commands/tm/to-done.md +47 -0
- package/.claude/commands/tm/to-in-progress.md +39 -0
- package/.claude/commands/tm/to-pending.md +35 -0
- package/.claude/commands/tm/to-review.md +43 -0
- package/.claude/commands/tm/update-single-task.md +122 -0
- package/.claude/commands/tm/update-task.md +75 -0
- package/.claude/commands/tm/update-tasks-from-id.md +111 -0
- package/.claude/commands/tm/validate-dependencies.md +72 -0
- package/.claude/commands/tm/view-models.md +52 -0
- package/.claude/settings.local.json +17 -3
- package/.cursor/commands/tm/add-dependency.md +55 -0
- package/.cursor/commands/tm/add-subtask.md +76 -0
- package/.cursor/commands/tm/add-task.md +78 -0
- package/.cursor/commands/tm/analyze-complexity.md +121 -0
- package/.cursor/commands/tm/analyze-project.md +97 -0
- package/.cursor/commands/tm/auto-implement-tasks.md +97 -0
- package/.cursor/commands/tm/command-pipeline.md +77 -0
- package/.cursor/commands/tm/complexity-report.md +117 -0
- package/.cursor/commands/tm/convert-task-to-subtask.md +71 -0
- package/.cursor/commands/tm/expand-all-tasks.md +51 -0
- package/.cursor/commands/tm/expand-task.md +49 -0
- package/.cursor/commands/tm/fix-dependencies.md +81 -0
- package/.cursor/commands/tm/help.md +98 -0
- package/.cursor/commands/tm/init-project-quick.md +46 -0
- package/.cursor/commands/tm/init-project.md +50 -0
- package/.cursor/commands/tm/install-taskmaster.md +117 -0
- package/.cursor/commands/tm/learn.md +103 -0
- package/.cursor/commands/tm/list-tasks-by-status.md +39 -0
- package/.cursor/commands/tm/list-tasks-with-subtasks.md +29 -0
- package/.cursor/commands/tm/list-tasks.md +43 -0
- package/.cursor/commands/tm/next-task.md +66 -0
- package/.cursor/commands/tm/parse-prd-with-research.md +48 -0
- package/.cursor/commands/tm/parse-prd.md +49 -0
- package/.cursor/commands/tm/project-status.md +64 -0
- package/.cursor/commands/tm/quick-install-taskmaster.md +22 -0
- package/.cursor/commands/tm/remove-all-subtasks.md +93 -0
- package/.cursor/commands/tm/remove-dependency.md +62 -0
- package/.cursor/commands/tm/remove-subtask.md +84 -0
- package/.cursor/commands/tm/remove-subtasks.md +86 -0
- package/.cursor/commands/tm/remove-task.md +107 -0
- package/.cursor/commands/tm/setup-models.md +51 -0
- package/.cursor/commands/tm/show-task.md +82 -0
- package/.cursor/commands/tm/smart-workflow.md +55 -0
- package/.cursor/commands/tm/sync-readme.md +117 -0
- package/.cursor/commands/tm/tm-main.md +146 -0
- package/.cursor/commands/tm/to-cancelled.md +55 -0
- package/.cursor/commands/tm/to-deferred.md +47 -0
- package/.cursor/commands/tm/to-done.md +44 -0
- package/.cursor/commands/tm/to-in-progress.md +36 -0
- package/.cursor/commands/tm/to-pending.md +32 -0
- package/.cursor/commands/tm/to-review.md +40 -0
- package/.cursor/commands/tm/update-single-task.md +119 -0
- package/.cursor/commands/tm/update-task.md +72 -0
- package/.cursor/commands/tm/update-tasks-from-id.md +108 -0
- package/.cursor/commands/tm/validate-dependencies.md +71 -0
- package/.cursor/commands/tm/view-models.md +51 -0
- package/.cursor/mcp.json +20 -0
- package/.cursor/rules/cursor_rules.mdc +53 -0
- package/.cursor/rules/self_improve.mdc +72 -0
- package/.cursor/rules/taskmaster/dev_workflow.mdc +424 -0
- package/.cursor/rules/taskmaster/taskmaster.mdc +573 -0
- package/.env.example +12 -0
- package/.gemini/commands/tm/add-dependency.toml +58 -0
- package/.gemini/commands/tm/add-subtask.toml +79 -0
- package/.gemini/commands/tm/add-task.toml +81 -0
- package/.gemini/commands/tm/analyze-complexity.toml +124 -0
- package/.gemini/commands/tm/analyze-project.toml +100 -0
- package/.gemini/commands/tm/auto-implement-tasks.toml +100 -0
- package/.gemini/commands/tm/command-pipeline.toml +80 -0
- package/.gemini/commands/tm/complexity-report.toml +120 -0
- package/.gemini/commands/tm/convert-task-to-subtask.toml +74 -0
- package/.gemini/commands/tm/expand-all-tasks.toml +54 -0
- package/.gemini/commands/tm/expand-task.toml +52 -0
- package/.gemini/commands/tm/fix-dependencies.toml +84 -0
- package/.gemini/commands/tm/help.toml +101 -0
- package/.gemini/commands/tm/init-project-quick.toml +49 -0
- package/.gemini/commands/tm/init-project.toml +53 -0
- package/.gemini/commands/tm/install-taskmaster.toml +120 -0
- package/.gemini/commands/tm/learn.toml +106 -0
- package/.gemini/commands/tm/list-tasks-by-status.toml +42 -0
- package/.gemini/commands/tm/list-tasks-with-subtasks.toml +32 -0
- package/.gemini/commands/tm/list-tasks.toml +46 -0
- package/.gemini/commands/tm/next-task.toml +69 -0
- package/.gemini/commands/tm/parse-prd-with-research.toml +51 -0
- package/.gemini/commands/tm/parse-prd.toml +52 -0
- package/.gemini/commands/tm/project-status.toml +67 -0
- package/.gemini/commands/tm/quick-install-taskmaster.toml +25 -0
- package/.gemini/commands/tm/remove-all-subtasks.toml +96 -0
- package/.gemini/commands/tm/remove-dependency.toml +65 -0
- package/.gemini/commands/tm/remove-subtask.toml +87 -0
- package/.gemini/commands/tm/remove-subtasks.toml +89 -0
- package/.gemini/commands/tm/remove-task.toml +110 -0
- package/.gemini/commands/tm/setup-models.toml +54 -0
- package/.gemini/commands/tm/show-task.toml +85 -0
- package/.gemini/commands/tm/smart-workflow.toml +58 -0
- package/.gemini/commands/tm/sync-readme.toml +120 -0
- package/.gemini/commands/tm/tm-main.toml +149 -0
- package/.gemini/commands/tm/to-cancelled.toml +58 -0
- package/.gemini/commands/tm/to-deferred.toml +50 -0
- package/.gemini/commands/tm/to-done.toml +47 -0
- package/.gemini/commands/tm/to-in-progress.toml +39 -0
- package/.gemini/commands/tm/to-pending.toml +35 -0
- package/.gemini/commands/tm/to-review.toml +43 -0
- package/.gemini/commands/tm/update-single-task.toml +122 -0
- package/.gemini/commands/tm/update-task.toml +75 -0
- package/.gemini/commands/tm/update-tasks-from-id.toml +111 -0
- package/.gemini/commands/tm/validate-dependencies.toml +74 -0
- package/.gemini/commands/tm/view-models.toml +54 -0
- package/.gemini/settings.json +20 -0
- package/.mcp.json +15 -0
- package/.taskmaster/CLAUDE.md +435 -0
- package/.taskmaster/config.json +44 -0
- package/.taskmaster/docs/prd.txt +584 -0
- package/.taskmaster/state.json +6 -0
- package/.taskmaster/tasks/tasks.json +304 -0
- package/.taskmaster/templates/example_prd.txt +47 -0
- package/.taskmaster/templates/example_prd_rpg.txt +511 -0
- package/CLAUDE.md +4 -138
- package/README.md +551 -0
- package/coverage/clover.xml +134 -22
- package/coverage/coverage-final.json +1 -1
- package/coverage/lcov-report/index.html +21 -21
- package/coverage/lcov-report/index.js.html +854 -29
- package/coverage/lcov.info +246 -39
- package/internal-docs/CLAUDE.md +139 -0
- package/internal-docs/NPM_DEPLOYMENT_GUIDE.md +203 -0
- package/internal-docs/OBSIDIAN_PROJECT_PROMPT.md +302 -0
- package/lib/index.d.ts +88 -0
- package/lib/index.js +275 -0
- package/package.json +11 -3
- /package/{DEPLOYMENT.md → internal-docs/DEPLOYMENT.md} +0 -0
- /package/{TEST_RESULTS.md → internal-docs/TEST_RESULTS.md} +0 -0
- /package/{TEST_SIMULATION.md → internal-docs/TEST_SIMULATION.md} +0 -0
|
@@ -0,0 +1,584 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "jell-utils.js v0.2.0 - 기획서"
|
|
3
|
+
category: Projects
|
|
4
|
+
tags: [npm, typescript, utility-library, open-source, v0.2.0, update]
|
|
5
|
+
created: 2025-12-26
|
|
6
|
+
modified: 2025-12-26
|
|
7
|
+
status: 🟡 Planning
|
|
8
|
+
version: 0.2.0
|
|
9
|
+
related: [[Archive/Completed_Projects/jell-utils.js/📊 개발 완료 보고서]], [[Projects MOC]]
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# 📦 jell-utils.js v0.2.0 기획서
|
|
13
|
+
|
|
14
|
+
> **한국어 특화 TypeScript 유틸리티 라이브러리 - 메이저 업데이트!**
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## 📊 1. 프로젝트 개요
|
|
19
|
+
|
|
20
|
+
### 1.1 현재 상태 (v0.1.0)
|
|
21
|
+
|
|
22
|
+
| 항목 | 값 |
|
|
23
|
+
| ---- | -- |
|
|
24
|
+
| 버전 | v0.1.0 |
|
|
25
|
+
| 배포일 | 2025-10-11 |
|
|
26
|
+
| npm | https://www.npmjs.com/package/jell-utils |
|
|
27
|
+
| GitHub | https://github.com/jellive/jell-utils.js |
|
|
28
|
+
| 테스트 | 50개 (79.67% 커버리지) |
|
|
29
|
+
| 함수 | 30개+ |
|
|
30
|
+
|
|
31
|
+
### 1.2 v0.2.0 목표
|
|
32
|
+
|
|
33
|
+
| 항목 | 목표 |
|
|
34
|
+
| ---- | ---- |
|
|
35
|
+
| 새 함수 | **+15개** (45개+ 총) |
|
|
36
|
+
| 테스트 커버리지 | **90%+** (현재 79.67%) |
|
|
37
|
+
| 카테고리 | **+3개** (날짜/숫자/검증) |
|
|
38
|
+
| 한국어 특화 | **강화** (전화번호, 사업자번호 등) |
|
|
39
|
+
|
|
40
|
+
### 1.3 예상 개발 시간
|
|
41
|
+
|
|
42
|
+
| 작업 | 시간 |
|
|
43
|
+
| ---- | ---- |
|
|
44
|
+
| 날짜/시간 유틸리티 | 1시간 |
|
|
45
|
+
| 숫자 포맷 유틸리티 | 1시간 |
|
|
46
|
+
| 검증 유틸리티 | 1시간 |
|
|
47
|
+
| 테스트 작성 | 1시간 |
|
|
48
|
+
| 문서화 & 배포 | 30분 |
|
|
49
|
+
| **합계** | **4-5시간** |
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## ✨ 2. 새로운 기능
|
|
54
|
+
|
|
55
|
+
### 2.1 📅 날짜/시간 유틸리티 (4개)
|
|
56
|
+
|
|
57
|
+
#### `formatDate(date, format)`
|
|
58
|
+
|
|
59
|
+
날짜를 원하는 형식으로 포맷
|
|
60
|
+
|
|
61
|
+
```typescript
|
|
62
|
+
import { formatDate } from 'jell-utils';
|
|
63
|
+
|
|
64
|
+
formatDate(new Date(), 'YYYY-MM-DD'); // '2025-12-26'
|
|
65
|
+
formatDate(new Date(), 'YYYY년 MM월 DD일'); // '2025년 12월 26일'
|
|
66
|
+
formatDate(new Date(), 'YYYY/MM/DD HH:mm'); // '2025/12/26 14:30'
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
**지원 토큰**:
|
|
70
|
+
- `YYYY`: 4자리 연도
|
|
71
|
+
- `MM`: 2자리 월 (01-12)
|
|
72
|
+
- `DD`: 2자리 일 (01-31)
|
|
73
|
+
- `HH`: 2자리 시 (00-23)
|
|
74
|
+
- `mm`: 2자리 분 (00-59)
|
|
75
|
+
- `ss`: 2자리 초 (00-59)
|
|
76
|
+
- `ddd`: 요일 (월, 화, 수, ...)
|
|
77
|
+
- `dddd`: 요일 전체 (월요일, 화요일, ...)
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
#### `timeAgo(date)`
|
|
82
|
+
|
|
83
|
+
상대적 시간 표시 (한국어)
|
|
84
|
+
|
|
85
|
+
```typescript
|
|
86
|
+
import { timeAgo } from 'jell-utils';
|
|
87
|
+
|
|
88
|
+
timeAgo(new Date(Date.now() - 30000)); // '방금 전'
|
|
89
|
+
timeAgo(new Date(Date.now() - 3600000)); // '1시간 전'
|
|
90
|
+
timeAgo(new Date(Date.now() - 86400000)); // '어제'
|
|
91
|
+
timeAgo(new Date(Date.now() - 172800000)); // '2일 전'
|
|
92
|
+
timeAgo(new Date('2025-01-01')); // '11개월 전'
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
**시간 단위**:
|
|
96
|
+
- 1분 미만: "방금 전"
|
|
97
|
+
- 1시간 미만: "X분 전"
|
|
98
|
+
- 24시간 미만: "X시간 전"
|
|
99
|
+
- 48시간 미만: "어제"
|
|
100
|
+
- 7일 미만: "X일 전"
|
|
101
|
+
- 30일 미만: "X주 전"
|
|
102
|
+
- 12개월 미만: "X개월 전"
|
|
103
|
+
- 그 이상: "X년 전"
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
#### `getDaysInMonth(year, month)`
|
|
108
|
+
|
|
109
|
+
해당 월의 일수 반환
|
|
110
|
+
|
|
111
|
+
```typescript
|
|
112
|
+
import { getDaysInMonth } from 'jell-utils';
|
|
113
|
+
|
|
114
|
+
getDaysInMonth(2025, 2); // 28 (평년)
|
|
115
|
+
getDaysInMonth(2024, 2); // 29 (윤년)
|
|
116
|
+
getDaysInMonth(2025, 12); // 31
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
#### `isLeapYear(year)`
|
|
122
|
+
|
|
123
|
+
윤년 여부 확인
|
|
124
|
+
|
|
125
|
+
```typescript
|
|
126
|
+
import { isLeapYear } from 'jell-utils';
|
|
127
|
+
|
|
128
|
+
isLeapYear(2024); // true
|
|
129
|
+
isLeapYear(2025); // false
|
|
130
|
+
isLeapYear(2000); // true
|
|
131
|
+
isLeapYear(1900); // false
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
### 2.2 💰 숫자 포맷 유틸리티 (5개)
|
|
137
|
+
|
|
138
|
+
#### `formatNumber(number)`
|
|
139
|
+
|
|
140
|
+
천 단위 쉼표 포맷
|
|
141
|
+
|
|
142
|
+
```typescript
|
|
143
|
+
import { formatNumber } from 'jell-utils';
|
|
144
|
+
|
|
145
|
+
formatNumber(1000); // '1,000'
|
|
146
|
+
formatNumber(1234567); // '1,234,567'
|
|
147
|
+
formatNumber(1234.56); // '1,234.56'
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
#### `formatCurrency(amount, currency?)`
|
|
153
|
+
|
|
154
|
+
통화 포맷 (기본: 원화)
|
|
155
|
+
|
|
156
|
+
```typescript
|
|
157
|
+
import { formatCurrency } from 'jell-utils';
|
|
158
|
+
|
|
159
|
+
formatCurrency(1000); // '1,000원'
|
|
160
|
+
formatCurrency(1234567); // '1,234,567원'
|
|
161
|
+
formatCurrency(1000, 'USD'); // '$1,000'
|
|
162
|
+
formatCurrency(1000, 'EUR'); // '€1,000'
|
|
163
|
+
formatCurrency(1000, 'JPY'); // '¥1,000'
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
#### `formatFileSize(bytes, precision?)`
|
|
169
|
+
|
|
170
|
+
파일 크기 포맷
|
|
171
|
+
|
|
172
|
+
```typescript
|
|
173
|
+
import { formatFileSize } from 'jell-utils';
|
|
174
|
+
|
|
175
|
+
formatFileSize(1024); // '1 KB'
|
|
176
|
+
formatFileSize(1048576); // '1 MB'
|
|
177
|
+
formatFileSize(1073741824); // '1 GB'
|
|
178
|
+
formatFileSize(1536, 2); // '1.50 KB'
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
#### `numberToKorean(number)`
|
|
184
|
+
|
|
185
|
+
숫자를 한글로 변환
|
|
186
|
+
|
|
187
|
+
```typescript
|
|
188
|
+
import { numberToKorean } from 'jell-utils';
|
|
189
|
+
|
|
190
|
+
numberToKorean(123); // '백이십삼'
|
|
191
|
+
numberToKorean(1234); // '천이백삼십사'
|
|
192
|
+
numberToKorean(12345); // '만이천삼백사십오'
|
|
193
|
+
numberToKorean(100000000); // '일억'
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
---
|
|
197
|
+
|
|
198
|
+
#### `parseNumber(str)`
|
|
199
|
+
|
|
200
|
+
문자열에서 숫자 추출
|
|
201
|
+
|
|
202
|
+
```typescript
|
|
203
|
+
import { parseNumber } from 'jell-utils';
|
|
204
|
+
|
|
205
|
+
parseNumber('1,234'); // 1234
|
|
206
|
+
parseNumber('1,234.56'); // 1234.56
|
|
207
|
+
parseNumber('$1,000'); // 1000
|
|
208
|
+
parseNumber('1,000원'); // 1000
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
### 2.3 ✅ 검증 유틸리티 (6개)
|
|
214
|
+
|
|
215
|
+
#### `isEmail(email)`
|
|
216
|
+
|
|
217
|
+
이메일 주소 검증
|
|
218
|
+
|
|
219
|
+
```typescript
|
|
220
|
+
import { isEmail } from 'jell-utils';
|
|
221
|
+
|
|
222
|
+
isEmail('test@example.com'); // true
|
|
223
|
+
isEmail('invalid-email'); // false
|
|
224
|
+
isEmail('test@test'); // false
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
---
|
|
228
|
+
|
|
229
|
+
#### `isPhoneNumber(phone)`
|
|
230
|
+
|
|
231
|
+
한국 전화번호 검증
|
|
232
|
+
|
|
233
|
+
```typescript
|
|
234
|
+
import { isPhoneNumber } from 'jell-utils';
|
|
235
|
+
|
|
236
|
+
isPhoneNumber('010-1234-5678'); // true
|
|
237
|
+
isPhoneNumber('01012345678'); // true
|
|
238
|
+
isPhoneNumber('02-123-4567'); // true (지역번호)
|
|
239
|
+
isPhoneNumber('1234-5678'); // false
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
---
|
|
243
|
+
|
|
244
|
+
#### `isUrl(url)`
|
|
245
|
+
|
|
246
|
+
URL 검증
|
|
247
|
+
|
|
248
|
+
```typescript
|
|
249
|
+
import { isUrl } from 'jell-utils';
|
|
250
|
+
|
|
251
|
+
isUrl('https://example.com'); // true
|
|
252
|
+
isUrl('http://localhost:3000'); // true
|
|
253
|
+
isUrl('ftp://files.example.com'); // true
|
|
254
|
+
isUrl('not-a-url'); // false
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
---
|
|
258
|
+
|
|
259
|
+
#### `isBusinessNumber(brn)`
|
|
260
|
+
|
|
261
|
+
한국 사업자등록번호 검증 (10자리)
|
|
262
|
+
|
|
263
|
+
```typescript
|
|
264
|
+
import { isBusinessNumber } from 'jell-utils';
|
|
265
|
+
|
|
266
|
+
isBusinessNumber('123-45-67890'); // true (유효한 경우)
|
|
267
|
+
isBusinessNumber('1234567890'); // true (하이픈 없이)
|
|
268
|
+
isBusinessNumber('000-00-00000'); // false (무효)
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
**검증 알고리즘**: 국세청 사업자등록번호 검증 공식 적용
|
|
272
|
+
|
|
273
|
+
---
|
|
274
|
+
|
|
275
|
+
#### `formatPhoneNumber(phone)`
|
|
276
|
+
|
|
277
|
+
전화번호 포맷팅
|
|
278
|
+
|
|
279
|
+
```typescript
|
|
280
|
+
import { formatPhoneNumber } from 'jell-utils';
|
|
281
|
+
|
|
282
|
+
formatPhoneNumber('01012345678'); // '010-1234-5678'
|
|
283
|
+
formatPhoneNumber('0212345678'); // '02-1234-5678'
|
|
284
|
+
formatPhoneNumber('03112345678'); // '031-1234-5678'
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
---
|
|
288
|
+
|
|
289
|
+
#### `formatBusinessNumber(brn)`
|
|
290
|
+
|
|
291
|
+
사업자등록번호 포맷팅
|
|
292
|
+
|
|
293
|
+
```typescript
|
|
294
|
+
import { formatBusinessNumber } from 'jell-utils';
|
|
295
|
+
|
|
296
|
+
formatBusinessNumber('1234567890'); // '123-45-67890'
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
---
|
|
300
|
+
|
|
301
|
+
## 🏗️ 3. 기술 스펙
|
|
302
|
+
|
|
303
|
+
### 3.1 프로젝트 구조
|
|
304
|
+
|
|
305
|
+
```
|
|
306
|
+
jell-utils.js/
|
|
307
|
+
├── src/
|
|
308
|
+
│ ├── index.ts # 메인 엔트리
|
|
309
|
+
│ ├── hangul/ # 한글 유틸리티 (기존)
|
|
310
|
+
│ │ └── index.ts
|
|
311
|
+
│ ├── string/ # 문자열 유틸리티 (기존)
|
|
312
|
+
│ │ └── index.ts
|
|
313
|
+
│ ├── object/ # 객체 유틸리티 (기존)
|
|
314
|
+
│ │ └── index.ts
|
|
315
|
+
│ ├── array/ # 배열 유틸리티 (기존)
|
|
316
|
+
│ │ └── index.ts
|
|
317
|
+
│ ├── async/ # 비동기 유틸리티 (기존)
|
|
318
|
+
│ │ └── index.ts
|
|
319
|
+
│ ├── date/ # 🆕 날짜/시간 유틸리티
|
|
320
|
+
│ │ ├── index.ts
|
|
321
|
+
│ │ ├── formatDate.ts
|
|
322
|
+
│ │ ├── timeAgo.ts
|
|
323
|
+
│ │ ├── getDaysInMonth.ts
|
|
324
|
+
│ │ └── isLeapYear.ts
|
|
325
|
+
│ ├── number/ # 🆕 숫자 유틸리티
|
|
326
|
+
│ │ ├── index.ts
|
|
327
|
+
│ │ ├── formatNumber.ts
|
|
328
|
+
│ │ ├── formatCurrency.ts
|
|
329
|
+
│ │ ├── formatFileSize.ts
|
|
330
|
+
│ │ ├── numberToKorean.ts
|
|
331
|
+
│ │ └── parseNumber.ts
|
|
332
|
+
│ └── validation/ # 🆕 검증 유틸리티
|
|
333
|
+
│ ├── index.ts
|
|
334
|
+
│ ├── isEmail.ts
|
|
335
|
+
│ ├── isPhoneNumber.ts
|
|
336
|
+
│ ├── isUrl.ts
|
|
337
|
+
│ ├── isBusinessNumber.ts
|
|
338
|
+
│ ├── formatPhoneNumber.ts
|
|
339
|
+
│ └── formatBusinessNumber.ts
|
|
340
|
+
├── __tests__/
|
|
341
|
+
│ ├── date/ # 🆕
|
|
342
|
+
│ │ ├── formatDate.test.ts
|
|
343
|
+
│ │ ├── timeAgo.test.ts
|
|
344
|
+
│ │ ├── getDaysInMonth.test.ts
|
|
345
|
+
│ │ └── isLeapYear.test.ts
|
|
346
|
+
│ ├── number/ # 🆕
|
|
347
|
+
│ │ ├── formatNumber.test.ts
|
|
348
|
+
│ │ ├── formatCurrency.test.ts
|
|
349
|
+
│ │ ├── formatFileSize.test.ts
|
|
350
|
+
│ │ ├── numberToKorean.test.ts
|
|
351
|
+
│ │ └── parseNumber.test.ts
|
|
352
|
+
│ └── validation/ # 🆕
|
|
353
|
+
│ ├── isEmail.test.ts
|
|
354
|
+
│ ├── isPhoneNumber.test.ts
|
|
355
|
+
│ ├── isUrl.test.ts
|
|
356
|
+
│ ├── isBusinessNumber.test.ts
|
|
357
|
+
│ ├── formatPhoneNumber.test.ts
|
|
358
|
+
│ └── formatBusinessNumber.test.ts
|
|
359
|
+
├── package.json
|
|
360
|
+
├── tsconfig.json
|
|
361
|
+
├── jest.config.js
|
|
362
|
+
└── README.md
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
### 3.2 타입 정의
|
|
366
|
+
|
|
367
|
+
```typescript
|
|
368
|
+
// date/types.ts
|
|
369
|
+
export type DateFormatToken =
|
|
370
|
+
| 'YYYY' | 'MM' | 'DD'
|
|
371
|
+
| 'HH' | 'mm' | 'ss'
|
|
372
|
+
| 'ddd' | 'dddd';
|
|
373
|
+
|
|
374
|
+
export interface TimeAgoOptions {
|
|
375
|
+
locale?: 'ko' | 'en';
|
|
376
|
+
now?: Date;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
// number/types.ts
|
|
380
|
+
export type CurrencyCode = 'KRW' | 'USD' | 'EUR' | 'JPY' | 'CNY';
|
|
381
|
+
|
|
382
|
+
export interface FormatCurrencyOptions {
|
|
383
|
+
currency?: CurrencyCode;
|
|
384
|
+
showSymbol?: boolean;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
// validation/types.ts
|
|
388
|
+
export interface PhoneNumberOptions {
|
|
389
|
+
country?: 'KR' | 'US';
|
|
390
|
+
strict?: boolean;
|
|
391
|
+
}
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
---
|
|
395
|
+
|
|
396
|
+
## 🧪 4. 테스트 계획
|
|
397
|
+
|
|
398
|
+
### 4.1 테스트 케이스 (예상 60개+)
|
|
399
|
+
|
|
400
|
+
| 카테고리 | 함수 수 | 테스트 수 |
|
|
401
|
+
| -------- | ------- | --------- |
|
|
402
|
+
| 날짜/시간 | 4개 | 16개 |
|
|
403
|
+
| 숫자 포맷 | 5개 | 20개 |
|
|
404
|
+
| 검증 | 6개 | 24개 |
|
|
405
|
+
| **합계** | **15개** | **60개+** |
|
|
406
|
+
|
|
407
|
+
### 4.2 테스트 예시
|
|
408
|
+
|
|
409
|
+
```typescript
|
|
410
|
+
// __tests__/date/formatDate.test.ts
|
|
411
|
+
describe('formatDate', () => {
|
|
412
|
+
it('should format date with YYYY-MM-DD', () => {
|
|
413
|
+
const date = new Date('2025-12-26');
|
|
414
|
+
expect(formatDate(date, 'YYYY-MM-DD')).toBe('2025-12-26');
|
|
415
|
+
});
|
|
416
|
+
|
|
417
|
+
it('should format date with Korean format', () => {
|
|
418
|
+
const date = new Date('2025-12-26');
|
|
419
|
+
expect(formatDate(date, 'YYYY년 MM월 DD일')).toBe('2025년 12월 26일');
|
|
420
|
+
});
|
|
421
|
+
|
|
422
|
+
it('should handle weekday tokens', () => {
|
|
423
|
+
const date = new Date('2025-12-26'); // 금요일
|
|
424
|
+
expect(formatDate(date, 'dddd')).toBe('금요일');
|
|
425
|
+
expect(formatDate(date, 'ddd')).toBe('금');
|
|
426
|
+
});
|
|
427
|
+
});
|
|
428
|
+
|
|
429
|
+
// __tests__/validation/isBusinessNumber.test.ts
|
|
430
|
+
describe('isBusinessNumber', () => {
|
|
431
|
+
it('should validate correct business number', () => {
|
|
432
|
+
expect(isBusinessNumber('123-45-67890')).toBe(true);
|
|
433
|
+
});
|
|
434
|
+
|
|
435
|
+
it('should validate without hyphens', () => {
|
|
436
|
+
expect(isBusinessNumber('1234567890')).toBe(true);
|
|
437
|
+
});
|
|
438
|
+
|
|
439
|
+
it('should reject invalid checksum', () => {
|
|
440
|
+
expect(isBusinessNumber('000-00-00000')).toBe(false);
|
|
441
|
+
});
|
|
442
|
+
});
|
|
443
|
+
```
|
|
444
|
+
|
|
445
|
+
### 4.3 커버리지 목표
|
|
446
|
+
|
|
447
|
+
| 메트릭 | 현재 (v0.1.0) | 목표 (v0.2.0) |
|
|
448
|
+
| ------ | ------------- | ------------- |
|
|
449
|
+
| Statements | 79.67% | **90%+** |
|
|
450
|
+
| Branches | 75.32% | **85%+** |
|
|
451
|
+
| Functions | 85.14% | **95%+** |
|
|
452
|
+
| Lines | 79.67% | **90%+** |
|
|
453
|
+
|
|
454
|
+
---
|
|
455
|
+
|
|
456
|
+
## 📅 5. 개발 일정
|
|
457
|
+
|
|
458
|
+
### 5.1 Phase 1: 구현 (3시간)
|
|
459
|
+
|
|
460
|
+
| 시간 | 작업 |
|
|
461
|
+
| ---- | ---- |
|
|
462
|
+
| 0:00-1:00 | 날짜/시간 유틸리티 4개 구현 |
|
|
463
|
+
| 1:00-2:00 | 숫자 포맷 유틸리티 5개 구현 |
|
|
464
|
+
| 2:00-3:00 | 검증 유틸리티 6개 구현 |
|
|
465
|
+
|
|
466
|
+
### 5.2 Phase 2: 테스트 (1시간)
|
|
467
|
+
|
|
468
|
+
| 시간 | 작업 |
|
|
469
|
+
| ---- | ---- |
|
|
470
|
+
| 3:00-3:30 | 테스트 작성 (60개+) |
|
|
471
|
+
| 3:30-4:00 | 커버리지 확인 및 보완 |
|
|
472
|
+
|
|
473
|
+
### 5.3 Phase 3: 배포 (30분)
|
|
474
|
+
|
|
475
|
+
| 시간 | 작업 |
|
|
476
|
+
| ---- | ---- |
|
|
477
|
+
| 4:00-4:15 | README 업데이트 |
|
|
478
|
+
| 4:15-4:30 | npm publish (v0.2.0) |
|
|
479
|
+
|
|
480
|
+
---
|
|
481
|
+
|
|
482
|
+
## 📊 6. 성공 기준
|
|
483
|
+
|
|
484
|
+
### 6.1 필수 (Must Have)
|
|
485
|
+
|
|
486
|
+
- [ ] 새 함수 15개 구현
|
|
487
|
+
- [ ] 테스트 60개+ 작성
|
|
488
|
+
- [ ] 커버리지 90%+ 달성
|
|
489
|
+
- [ ] npm v0.2.0 배포
|
|
490
|
+
- [ ] README 업데이트
|
|
491
|
+
|
|
492
|
+
### 6.2 권장 (Should Have)
|
|
493
|
+
|
|
494
|
+
- [ ] JSDoc 주석 모든 함수에 추가
|
|
495
|
+
- [ ] 타입 정의 완벽하게 제공
|
|
496
|
+
- [ ] 예제 코드 README에 추가
|
|
497
|
+
|
|
498
|
+
### 6.3 선택 (Nice to Have)
|
|
499
|
+
|
|
500
|
+
- [ ] 성능 벤치마크
|
|
501
|
+
- [ ] CHANGELOG.md 작성
|
|
502
|
+
- [ ] GitHub Release 생성
|
|
503
|
+
|
|
504
|
+
---
|
|
505
|
+
|
|
506
|
+
## 🔗 7. 참고 자료
|
|
507
|
+
|
|
508
|
+
### 7.1 한국 검증 규칙
|
|
509
|
+
|
|
510
|
+
**사업자등록번호 검증 공식**:
|
|
511
|
+
```
|
|
512
|
+
가중치: 1, 3, 7, 1, 3, 7, 1, 3, 5
|
|
513
|
+
마지막 자리 = 10 - ((가중치 * 각 자리 합) % 10) % 10
|
|
514
|
+
```
|
|
515
|
+
|
|
516
|
+
**전화번호 정규식**:
|
|
517
|
+
```typescript
|
|
518
|
+
// 휴대폰
|
|
519
|
+
/^01[016789]-?\d{3,4}-?\d{4}$/
|
|
520
|
+
|
|
521
|
+
// 지역번호
|
|
522
|
+
/^0[2-6][1-5]?-?\d{3,4}-?\d{4}$/
|
|
523
|
+
```
|
|
524
|
+
|
|
525
|
+
### 7.2 관련 프로젝트
|
|
526
|
+
|
|
527
|
+
- **Lodash**: 범용 유틸리티 (참고)
|
|
528
|
+
- **date-fns**: 날짜 유틸리티 (참고)
|
|
529
|
+
- **validator.js**: 검증 유틸리티 (참고)
|
|
530
|
+
|
|
531
|
+
---
|
|
532
|
+
|
|
533
|
+
## 📝 8. 체크리스트
|
|
534
|
+
|
|
535
|
+
### 개발 전
|
|
536
|
+
|
|
537
|
+
- [ ] GitHub 레포 클론
|
|
538
|
+
- [ ] 의존성 설치 (`npm install`)
|
|
539
|
+
- [ ] 기존 테스트 통과 확인
|
|
540
|
+
|
|
541
|
+
### 개발 중
|
|
542
|
+
|
|
543
|
+
- [ ] 각 함수별 테스트 먼저 작성 (TDD)
|
|
544
|
+
- [ ] 타입 정의 완벽하게
|
|
545
|
+
- [ ] JSDoc 주석 추가
|
|
546
|
+
|
|
547
|
+
### 배포 전
|
|
548
|
+
|
|
549
|
+
- [ ] 모든 테스트 통과
|
|
550
|
+
- [ ] 커버리지 90%+ 확인
|
|
551
|
+
- [ ] README 업데이트
|
|
552
|
+
- [ ] package.json 버전 업데이트 (0.1.0 → 0.2.0)
|
|
553
|
+
- [ ] `npm publish`
|
|
554
|
+
|
|
555
|
+
---
|
|
556
|
+
|
|
557
|
+
## 🎯 9. 예상 결과
|
|
558
|
+
|
|
559
|
+
### v0.2.0 릴리즈 후
|
|
560
|
+
|
|
561
|
+
| 항목 | v0.1.0 | v0.2.0 |
|
|
562
|
+
| ---- | ------ | ------ |
|
|
563
|
+
| 함수 개수 | 30개+ | **45개+** |
|
|
564
|
+
| 테스트 개수 | 50개 | **110개+** |
|
|
565
|
+
| 커버리지 | 79.67% | **90%+** |
|
|
566
|
+
| 카테고리 | 5개 | **8개** |
|
|
567
|
+
| 한국어 특화 | 기본 | **강화** |
|
|
568
|
+
|
|
569
|
+
### 포트폴리오 가치
|
|
570
|
+
|
|
571
|
+
- ✅ npm 배포 경험
|
|
572
|
+
- ✅ TypeScript 고급 활용
|
|
573
|
+
- ✅ TDD 방법론
|
|
574
|
+
- ✅ 오픈소스 기여
|
|
575
|
+
- ✅ 한국어 특화 유틸리티 (차별화!)
|
|
576
|
+
|
|
577
|
+
---
|
|
578
|
+
|
|
579
|
+
_기획서 작성일: 2025-12-26_
|
|
580
|
+
_작성자: PARA+GTD Automation Assistant 🤖_
|
|
581
|
+
_프로젝트 상태: 🟡 Planning_
|
|
582
|
+
|
|
583
|
+
#jell-utils #npm #typescript #v0.2.0 #update #planning
|
|
584
|
+
|