import { toArray } from "../../../prelude/array.js";
import { isHashtag } from "../type.js";
export function extractApHashtags(tags) {
    if (tags == null) return [];
    const hashtags = extractApHashtagObjects(tags);
    return hashtags.map((tag)=>{
        const m = tag.name.match(/^#(.+)/);
        return m ? m[1] : null;
    }).filter((x)=>x != null);
}
export function extractApHashtagObjects(tags) {
    if (tags == null) return [];
    return toArray(tags).filter(isHashtag);
}
