d071d18dd7
* wip * wip * fix * clean up * Update tsconfig.json * Update activitypub.ts * wip
10 lines
307 B
TypeScript
10 lines
307 B
TypeScript
import * as mfm from 'mfm-js';
|
|
import { unique } from '@/prelude/array.js';
|
|
|
|
export function extractHashtags(nodes: mfm.MfmNode[]): string[] {
|
|
const hashtagNodes = mfm.extract(nodes, (node) => node.type === 'hashtag');
|
|
const hashtags = unique(hashtagNodes.map(x => x.props.hashtag));
|
|
|
|
return hashtags;
|
|
}
|