@h-ai/datapipe 0.1.0-alpha.19 → 0.1.0-alpha.20

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.
Files changed (2) hide show
  1. package/README.md +5 -0
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -10,6 +10,8 @@
10
10
  | 文本分块 | 句子、段落、Markdown 标题、分页符、字数、字符、自定义分隔符 |
11
11
  | 管线组合 | 链式组合清洗 → 转换 → 分块 → 分块后处理,一次执行 |
12
12
 
13
+ > 安全提示:`customReplacements` 与 `mode: 'custom'` 的 `separator` 会作为正则使用。仅传入受信任、已审查的模式;不要把用户输入直接拼进正则,避免 ReDoS 或意外大范围替换。
14
+
13
15
  ## 快速开始
14
16
 
15
17
  ```ts
@@ -56,6 +58,9 @@ if (!result.success) {
56
58
  case HaiDatapipeError.CONFIG_ERROR.code:
57
59
  // 配置参数校验失败
58
60
  break
61
+ case HaiDatapipeError.PROCESSING_ERROR.code:
62
+ // 输入或自定义正则导致处理失败;记录错误并回退到安全默认策略
63
+ break
59
64
  }
60
65
  }
61
66
  ```
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@h-ai/datapipe",
3
3
  "type": "module",
4
- "version": "0.1.0-alpha.19",
4
+ "version": "0.1.0-alpha.20",
5
5
  "description": "Data processing pipeline module for hai-framework: clean, chunk, transform",
6
6
  "exports": {
7
7
  ".": {
@@ -19,7 +19,7 @@
19
19
  ],
20
20
  "dependencies": {
21
21
  "zod": "^4.4.3",
22
- "@h-ai/core": "0.1.0-alpha.19"
22
+ "@h-ai/core": "0.1.0-alpha.20"
23
23
  },
24
24
  "devDependencies": {
25
25
  "tsup": "^8.5.1",