3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-15 05:41:51 +00:00

Merge pull request #406 from DenverCoderOne/feat-Make-tag-list-search-case-insensitive

feat: Make tag list search case-insensitive
This commit is contained in:
Miikka 2023-07-01 15:56:55 +03:00 committed by GitHub
commit e207874ebf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -20,7 +20,7 @@ export const TagListCmd = tagsCmd({
const prefix = (await pluginData.config.getForMessage(msg)).prefix;
const tagNames = tags.map((tag) => tag.tag).sort();
const searchRegex = args.search ? new RegExp([...args.search].map((s) => escapeStringRegexp(s)).join(".*")) : null;
const searchRegex = args.search ? new RegExp([...args.search].map((s) => escapeStringRegexp(s)).join(".*"), "i") : null;
const filteredTags = args.search ? tagNames.filter((tag) => searchRegex!.test(tag)) : tagNames;