Skip to content

Commit 49d2820

Browse files
authored
Merge pull request #7 from klmhyeonwoo/feature/util-workspace
docs: modify README.md
2 parents 4f6bf7b + cf65e22 commit 49d2820

2 files changed

Lines changed: 102 additions & 8 deletions

File tree

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 dori
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 81 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,88 @@
1-
##### 이름하여 유틸 함수 모음집
1+
# @dori/utils
22

3-
##### stringUtil
3+
A comprehensive collection of TypeScript utility functions for modern web development.
44

5-
###### 문자열 관련 유틸함수
5+
## Features
66

7-
##### objectUtil
7+
- 🛠️ **Comprehensive**: String, object, cookie, number, and validation utilities
8+
- 📦 **Tree-shakable**: Import only what you need
9+
- 🔒 **Type-safe**: Full TypeScript support with type definitions
10+
-**Lightweight**: Minimal dependencies and optimized for performance
11+
- 🧪 **Well-tested**: Extensive test coverage with comprehensive test cases
812

9-
###### 오브젝트 관련 유틸함수
13+
## Installation
1014

11-
##### cookieUtil
15+
```bash
16+
npm install @dori/utils
17+
# or
18+
pnpm add @dori/utils
19+
# or
20+
yarn add @dori/utils
21+
```
1222

13-
###### 쿠키 관련 유틸 함수
23+
## Usage
1424

15-
##### 그 외에는 더 추가될 예정..
25+
```typescript
26+
import {
27+
stringUtil,
28+
objectUtil,
29+
cookieUtil,
30+
numberUtil,
31+
validationUtil,
32+
} from "@dori/utils";
33+
34+
// String utilities
35+
const escaped = stringUtil.escapeHtml("<div>Hello</div>");
36+
const unescaped = stringUtil.unescapeHtml("&lt;div&gt;Hello&lt;/div&gt;");
37+
38+
// Object utilities
39+
const cleaned = objectUtil.clearNullProperties({ a: 1, b: null, c: 3 });
40+
const frozen = objectUtil.deepFreeze({ a: { b: 1 } });
41+
42+
// Number utilities
43+
const total = numberUtil.sum(1, 2, 3, 4, 5); // 15
44+
const difference = numberUtil.subtract(10, 3); // 7
45+
46+
// Validation utilities
47+
const isValid = validationUtil.checkEmail("user@example.com"); // true
48+
const isHttpUrl = validationUtil.checkHttpUrl("https://example.com"); // true
49+
50+
// Cookie utilities
51+
cookieUtil.setCookie("theme", "dark");
52+
const theme = cookieUtil.getCookie("theme");
53+
```
54+
55+
## API Reference
56+
57+
### StringUtil
58+
59+
- `escapeHtml(str: string): string` - Escapes HTML special characters
60+
- `unescapeHtml(str: string): string` - Unescapes HTML entities
61+
62+
### ObjectUtil
63+
64+
- `clearNullProperties(obj: object): object` - Removes null/undefined properties
65+
- `deepFreeze(obj: object): object` - Deep freezes an object recursively
66+
67+
### NumberUtil
68+
69+
- `sum(...numbers: number[]): number` - Calculates sum of numbers
70+
- `subtract(...numbers: number[]): number` - Subtracts two numbers
71+
72+
### ValidationUtil
73+
74+
- `checkEmail(email: string): boolean` - Validates email format
75+
- `checkHttpUrl(url: string): boolean` - Validates HTTP/HTTPS URL format
76+
77+
### CookieUtil
78+
79+
- `setCookie(name: string, value: string, options?: object): void` - Sets a cookie
80+
- `getCookie(name: string): string | null` - Gets a cookie value
81+
82+
## Contributing
83+
84+
Contributions are welcome! Please read our contributing guidelines and submit pull requests to our repository.
85+
86+
## License
87+
88+
MIT License - see LICENSE file for details.

0 commit comments

Comments
 (0)