es-toolkit
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesees-toolkit Usage Guide
es-toolkit 使用指南
This skill provides guidelines and best practices for using the es-toolkit utility library in this project.
本指南提供了在本项目中使用es-toolkit工具库的使用规范和最佳实践。
Quick Reference
快速参考
MANDATORY: Always use instead of custom implementations or native methods.
es-toolkitFor detailed patterns, examples, and checklists, see:
- references/patterns.md - Complete usage patterns and migration guides
强制要求:始终使用,不要使用自定义实现或原生方法。
es-toolkit如需了解详细的使用模式、示例和检查清单,请查看:
- references/patterns.md - 完整的使用模式和迁移指南
Key Categories
核心分类
| Category | Module | Common Functions |
|---|---|---|
| Array | | |
| Object | | |
| String | | |
| Function | | |
| Util | | |
| 分类 | 模块 | 常用函数 |
|---|---|---|
| 数组 | | |
| 对象 | | |
| 字符串 | | |
| 函数 | | |
| 工具 | | |
Import Pattern
导入规范
Always import from specific modules for optimal tree-shaking:
typescript
// Good: Import from specific modules
import { compact } from "es-toolkit/array";
import { merge } from "es-toolkit/object";
// Bad: Import from root (larger bundle)
import { compact } from "es-toolkit";为了实现最优的tree-shaking效果,请始终从特定模块导入:
typescript
// Good: Import from specific modules
import { compact } from "es-toolkit/array";
import { merge } from "es-toolkit/object";
// Bad: Import from root (larger bundle)
import { compact } from "es-toolkit";Documentation
文档
- Official Docs: https://es-toolkit.dev/
- GitHub: https://github.com/toss/es-toolkit
- 官方文档:https://es-toolkit.dev/
- GitHub仓库:https://github.com/toss/es-toolkit