Refactor a few things, add policies to repository

This commit is contained in:
Jon Staab
2025-04-15 13:45:11 -07:00
parent ded668890f
commit 5785710137
3 changed files with 31 additions and 21 deletions
+4 -3
View File
@@ -1,6 +1,6 @@
import {npubEncode} from "nostr-tools/nip19"
import {ellipsize, parseJson} from "@welshman/lib"
import {TrustedEvent} from "./Events.js"
import {TrustedEvent, EventTemplate} from "./Events.js"
import {getLnUrl} from "./Zaps.js"
import {PROFILE} from "./Kinds.js"
@@ -50,12 +50,13 @@ export const readProfile = (event: TrustedEvent): PublishedProfile => ({
event,
})
export const createProfile = ({event, ...profile}: Profile) => ({
export const createProfile = ({event, ...profile}: Profile): EventTemplate => ({
kind: PROFILE,
content: JSON.stringify(profile),
tags: [],
})
export const editProfile = ({event, ...profile}: PublishedProfile) => ({
export const editProfile = ({event, ...profile}: PublishedProfile): EventTemplate => ({
kind: PROFILE,
content: JSON.stringify(profile),
tags: event.tags,