Skip to content

Commit 222fb40

Browse files
committed
feat: add slugify example and documentation to README
1 parent c2f38af commit 222fb40

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ import {
4141
// String utilities
4242
const escaped = stringUtil.escapeHtml("<div>Hello</div>");
4343
const unescaped = stringUtil.unescapeHtml("&lt;div&gt;Hello&lt;/div&gt;");
44+
const slug = stringUtil.slugify("Hello World! 안녕하세요"); // "hello-world-안녕하세요"
4445

4546
// Object utilities
4647
const cleaned = objectUtil.clearNullProperties({ a: 1, b: null, c: 3 });
@@ -150,6 +151,7 @@ storage.set("data", { key: "value" });
150151

151152
- `escapeHtml(str: string): string` - Escapes HTML special characters
152153
- `unescapeHtml(str: string): string` - Unescapes HTML entities
154+
- `slugify(text: string): string` - Converts a string to URL-friendly slug format. Replaces spaces with hyphens, removes special characters, converts to lowercase, and supports Korean characters (e.g., "Hello World! 안녕" → "hello-world-안녕")
153155

154156
### ObjectUtil
155157

@@ -212,6 +214,7 @@ storage.set("data", { key: "value" });
212214
### Retry
213215

214216
- `retry<T>(fn: () => Promise<T>, loop?: number): Promise<T>` - Retries an asynchronous function up to the specified number of times (default 3) if it fails. Automatically re-attempts on error and returns the result of the first successful execution, or throws the last error if all retries fail.
217+
215218
### SearchQueryUtil
216219

217220
- `getAllQuery(): Record<string, string | string[]>` - Parses the current URL's query string and returns an object with key-value pairs. Values appear as arrays when the same key is used multiple times.

0 commit comments

Comments
 (0)