mirror of
https://github.com/nonebot/nonebot2.git
synced 2024-11-28 03:05:25 +08:00
✨ Docs: 商店搜索大小写不敏感 (#1609)
This commit is contained in:
parent
6f57a290d7
commit
f46addbb85
@ -17,14 +17,16 @@ export type Obj = {
|
||||
};
|
||||
|
||||
export function filterObjs(filter: string, objs: Obj[]): Obj[] {
|
||||
let filterLower = filter.toLowerCase();
|
||||
return objs.filter((o) => {
|
||||
return (
|
||||
o.module_name?.includes(filter) ||
|
||||
o.project_link?.includes(filter) ||
|
||||
o.name.includes(filter) ||
|
||||
o.desc.includes(filter) ||
|
||||
o.author.includes(filter) ||
|
||||
o.tags.filter((t) => t.label.includes(filter)).length > 0
|
||||
o.module_name?.toLowerCase().includes(filterLower) ||
|
||||
o.project_link?.toLowerCase().includes(filterLower) ||
|
||||
o.name.toLowerCase().includes(filterLower) ||
|
||||
o.desc.toLowerCase().includes(filterLower) ||
|
||||
o.author.toLowerCase().includes(filterLower) ||
|
||||
o.tags.filter((t) => t.label.toLowerCase().includes(filterLower)).length >
|
||||
0
|
||||
);
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user