@easbot/utils 0.1.12 → 0.1.14
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/README.en.md +55 -0
- package/README.md +12 -76
- package/dist/chunks/{chunk-JRBFY3PQ.mjs → chunk-6MVBFBWB.mjs} +5 -5
- package/dist/chunks/{chunk-PQ3EETPA.cjs → chunk-ZNIQRHSA.cjs} +5 -5
- package/dist/chunks/log-CD3QO5T3.cjs +1 -0
- package/dist/chunks/log-OSKSGVSM.mjs +1 -0
- package/dist/index.cjs +39 -35
- package/dist/index.d.cts +18 -5
- package/dist/index.d.ts +18 -5
- package/dist/index.mjs +39 -35
- package/package.json +2 -2
- package/dist/chunks/log-S3VOL35O.mjs +0 -1
- package/dist/chunks/log-YI7B3XJ6.cjs +0 -1
package/README.en.md
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
[中文](./README.md) | English
|
|
2
|
+
|
|
3
|
+
# @easbot/utils
|
|
4
|
+
|
|
5
|
+
A modern, lightweight, and fast library for shared utilities in the EASBOT ecosystem.
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- **Common Utilities**: Date formatting, sleep, debounce, throttle, etc.
|
|
10
|
+
- **Type Safety**: Full TypeScript support with proper type inference
|
|
11
|
+
- **Zero Dependencies**: Minimal external dependencies
|
|
12
|
+
- **Tree-shakeable**: Only import what you need
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
pnpm add @easbot/utils
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
```typescript
|
|
23
|
+
import {
|
|
24
|
+
formatDate,
|
|
25
|
+
sleep,
|
|
26
|
+
debounce,
|
|
27
|
+
deepClone,
|
|
28
|
+
generateId
|
|
29
|
+
} from '@easbot/utils';
|
|
30
|
+
|
|
31
|
+
// Use utility functions
|
|
32
|
+
const id = generateId();
|
|
33
|
+
await sleep(1000);
|
|
34
|
+
const cloned = deepClone({ a: 1, b: { c: 2 } });
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Development
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
# Install dependencies
|
|
41
|
+
pnpm install
|
|
42
|
+
|
|
43
|
+
# Build
|
|
44
|
+
pnpm build
|
|
45
|
+
|
|
46
|
+
# Test
|
|
47
|
+
pnpm test
|
|
48
|
+
|
|
49
|
+
# Type check
|
|
50
|
+
pnpm type-check
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## License
|
|
54
|
+
|
|
55
|
+
MIT
|
package/README.md
CHANGED
|
@@ -1,80 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
[中文](#中文) | [English](#english)
|
|
1
|
+
[English](./README.en.md) | 中文
|
|
4
2
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
## 中文
|
|
3
|
+
# @easbot/utils
|
|
8
4
|
|
|
9
5
|
EASBOT 生态系统的共享工具库,现代化、轻量且高效。
|
|
10
6
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
```bash
|
|
14
|
-
npm install @easbot/utils
|
|
15
|
-
# 或
|
|
16
|
-
pnpm add @easbot/utils
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
### 使用
|
|
20
|
-
|
|
21
|
-
```typescript
|
|
22
|
-
import {
|
|
23
|
-
formatDate,
|
|
24
|
-
sleep,
|
|
25
|
-
debounce,
|
|
26
|
-
deepClone,
|
|
27
|
-
generateId
|
|
28
|
-
} from '@easbot/utils';
|
|
29
|
-
|
|
30
|
-
// 使用工具函数
|
|
31
|
-
const id = generateId();
|
|
32
|
-
await sleep(1000);
|
|
33
|
-
const cloned = deepClone({ a: 1, b: { c: 2 } });
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
### 特性
|
|
7
|
+
## 特性
|
|
37
8
|
|
|
38
9
|
- **常用工具**: 日期格式化、sleep、防抖、节流等
|
|
39
10
|
- **类型安全**: 完整的 TypeScript 支持和类型推断
|
|
40
11
|
- **零依赖**: 最小化外部依赖
|
|
41
12
|
- **Tree-shakeable**: 按需导入
|
|
42
13
|
|
|
43
|
-
|
|
14
|
+
## 安装
|
|
44
15
|
|
|
45
16
|
```bash
|
|
46
|
-
# 安装依赖
|
|
47
|
-
pnpm install
|
|
48
|
-
|
|
49
|
-
# 构建
|
|
50
|
-
pnpm build
|
|
51
|
-
|
|
52
|
-
# 测试
|
|
53
|
-
pnpm test
|
|
54
|
-
|
|
55
|
-
# 类型检查
|
|
56
|
-
pnpm type-check
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
### 许可证
|
|
60
|
-
|
|
61
|
-
MIT
|
|
62
|
-
|
|
63
|
-
---
|
|
64
|
-
|
|
65
|
-
## English
|
|
66
|
-
|
|
67
|
-
A modern, lightweight, and fast library for shared utilities in the EASBOT ecosystem.
|
|
68
|
-
|
|
69
|
-
### Installation
|
|
70
|
-
|
|
71
|
-
```bash
|
|
72
|
-
npm install @easbot/utils
|
|
73
|
-
# or
|
|
74
17
|
pnpm add @easbot/utils
|
|
75
18
|
```
|
|
76
19
|
|
|
77
|
-
|
|
20
|
+
## 使用
|
|
78
21
|
|
|
79
22
|
```typescript
|
|
80
23
|
import {
|
|
@@ -85,35 +28,28 @@ import {
|
|
|
85
28
|
generateId
|
|
86
29
|
} from '@easbot/utils';
|
|
87
30
|
|
|
88
|
-
//
|
|
31
|
+
// 使用工具函数
|
|
89
32
|
const id = generateId();
|
|
90
33
|
await sleep(1000);
|
|
91
34
|
const cloned = deepClone({ a: 1, b: { c: 2 } });
|
|
92
35
|
```
|
|
93
36
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
- **Common Utilities**: Date formatting, sleep, debounce, throttle, etc.
|
|
97
|
-
- **Type Safety**: Full TypeScript support with proper type inference
|
|
98
|
-
- **Zero Dependencies**: Minimal external dependencies
|
|
99
|
-
- **Tree-shakeable**: Only import what you need
|
|
100
|
-
|
|
101
|
-
### Development
|
|
37
|
+
## 开发
|
|
102
38
|
|
|
103
39
|
```bash
|
|
104
|
-
#
|
|
40
|
+
# 安装依赖
|
|
105
41
|
pnpm install
|
|
106
42
|
|
|
107
|
-
#
|
|
43
|
+
# 构建
|
|
108
44
|
pnpm build
|
|
109
45
|
|
|
110
|
-
#
|
|
46
|
+
# 测试
|
|
111
47
|
pnpm test
|
|
112
48
|
|
|
113
|
-
#
|
|
49
|
+
# 类型检查
|
|
114
50
|
pnpm type-check
|
|
115
51
|
```
|
|
116
52
|
|
|
117
|
-
|
|
53
|
+
## 许可证
|
|
118
54
|
|
|
119
55
|
MIT
|