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

7 lines
195 B
TypeScript
Raw Normal View History

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);
}