misskey/src/remote/activitypub/misc/get-emoji-names.ts

6 lines
195 B
TypeScript

import parse from '../../../mfm/parse';
export default function(text: string) {
if (!text) return [];
return parse(text).filter(t => t.type === 'emoji' && t.name).map(t => (t as any).name);
}