-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparamMap.ts
More file actions
54 lines (48 loc) · 883 Bytes
/
paramMap.ts
File metadata and controls
54 lines (48 loc) · 883 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/**
* @param paramName 参数 key
* @description 将 解释 key 转换
*/
export const paramMap = (paramName: string) => {
switch (paramName) {
case "name":
return {
en: "name",
zh: "名称"
};
case "desc":
case "description":
return {
en: "description",
zh: "描述"
};
case "return":
case "returns":
return {
en: "returns",
zh: "返参解释"
};
case "example":
case "examples":
return {
en: "examples",
zh: "示例"
};
case "tip":
case "tips":
return {
en: "tips",
zh: "注意"
};
// 特定 key, 会单独输出 params
case "param":
return {
en: "param",
zh: "参数"
};
default:
return {
en: paramName,
zh: paramName
}
}
}