import { safeParse } from "applesauce-core/helpers";
import { setContent } from "./content.js";
/** Sets the content of a kind 0 metadata event */
export function setProfile(content) {
    return setContent(JSON.stringify(content));
}
/** Updates the content of a kind 0 metadata event */
export function updateProfile(content) {
    return (draft) => {
        const existing = safeParse(draft.content) || {};
        return { ...draft, content: JSON.stringify({ ...existing, ...content }) };
    };
}
