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:
commit
e207874ebf
1 changed files with 1 additions and 1 deletions
|
@ -20,7 +20,7 @@ export const TagListCmd = tagsCmd({
|
||||||
|
|
||||||
const prefix = (await pluginData.config.getForMessage(msg)).prefix;
|
const prefix = (await pluginData.config.getForMessage(msg)).prefix;
|
||||||
const tagNames = tags.map((tag) => tag.tag).sort();
|
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;
|
const filteredTags = args.search ? tagNames.filter((tag) => searchRegex!.test(tag)) : tagNames;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue