Files
Sable/src/app/plugins/utils.ts
T
7w1 1717ca872f migrate to oxlint and oxfmt
ran formatter
fixed lint issues, primarily getting rid of "any"s and swapping to .toSorted()
2026-04-16 22:15:13 -05:00

20 lines
572 B
TypeScript

import type { SearchItemStrGetter } from '$hooks/useAsyncSearch';
import { PackImageReader } from './custom-emoji';
import type { IEmoji } from './emoji';
export const getEmoticonSearchStr: SearchItemStrGetter<PackImageReader | IEmoji> = (item) => {
const shortcode = `:${item.shortcode}:`;
if (item instanceof PackImageReader) {
if (item.body) {
return [shortcode, item.body];
}
return shortcode;
}
const names = [shortcode, item.label];
if (Array.isArray(item.shortcodes)) {
return names.concat(item.shortcodes);
}
return names;
};