mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-27 16:43:09 +02:00
10 lines
381 B
TypeScript
10 lines
381 B
TypeScript
// test is located in test/extract-mentions
|
|
|
|
import { MentionNode, MfmForest } from '../mfm/types';
|
|
import { preorderF } from '../prelude/tree';
|
|
|
|
export default function(mfmForest: MfmForest): MentionNode['props'][] {
|
|
// TODO: 重複を削除
|
|
const mentionNodes = preorderF(mfmForest).filter(x => x.type === 'mention') as MentionNode[];
|
|
return mentionNodes.map(x => x.props);
|
|
}
|