-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.js
45 lines (42 loc) · 915 Bytes
/
index.js
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
import alfy from "alfy";
import xhyx from "./xhyx.json";
const input = String(alfy.input).charAt(0)
const data = xhyx[input];
const getItems = () => {
if (data === "未收录") {
return [
{
title: `${input}: 未收录的字`,
subtitle: "非《通用规范汉字表》国发〔2013〕23号文规定用字,故未收录",
arg: input
}
];
} else if (data && data.length > 0) {
return [
{
title: data[0],
arg: input
},
{
title: `拆 分: ${data[1]}`,
arg: input
},
{
title: `首 末: ${data[2]} ${data[3]}`,
arg: input
},
{
title: `编 码: ${data[4]} ${data[5]}`,
arg: input
}
];
} else {
return [
{
title: "查询错误",
arg: input
}
];
}
};
alfy.output(getItems());