mm_validator 0.0.0-stage → 1.0.0

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.
@@ -0,0 +1,54 @@
1
+ {
2
+ "name": "type",
3
+ "handler": "validator",
4
+ "title": "类型验证器",
5
+ "description": "校验字段值是否为指定数据类型。适用场景:接口入参类型检查、防止脏数据流入下游、类型守卫分流时。工作流提示:field 填字段名、value 填待验证值、expected_type 填期望类型(string/number/boolean/array/object),结果看 valid 与 errors。",
6
+ "type": "core",
7
+ "params": {
8
+ "type": "object",
9
+ "properties": {
10
+ "field": {
11
+ "type": "string",
12
+ "description": "字段名称"
13
+ },
14
+ "value": {
15
+ "description": "待验证的值"
16
+ },
17
+ "expected_type": {
18
+ "type": "string",
19
+ "description": "期望的类型",
20
+ "enum": [
21
+ "string",
22
+ "number",
23
+ "boolean",
24
+ "array",
25
+ "object"
26
+ ]
27
+ }
28
+ },
29
+ "required": [
30
+ "field",
31
+ "value",
32
+ "expected_type"
33
+ ]
34
+ },
35
+ "returns": {
36
+ "type": "object",
37
+ "properties": {
38
+ "valid": {
39
+ "type": "boolean",
40
+ "description": "验证是否通过"
41
+ },
42
+ "tip": {
43
+ "type": "string",
44
+ "description": "提示信息,通过时为'参数校验通过',失败时包含错误数量和详情"
45
+ },
46
+ "errors": {
47
+ "type": "array",
48
+ "description": "错误信息列表"
49
+ }
50
+ }
51
+ },
52
+ "options": {},
53
+ "group": "check"
54
+ }
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.