Remove CustomEvent

This commit is contained in:
Jon Staab
2024-08-19 08:59:39 -07:00
parent 975d51cafa
commit 8d3ca2ef6a
25 changed files with 124 additions and 120 deletions
+4 -4
View File
@@ -1,6 +1,6 @@
import {nip19} from "nostr-tools"
import {ellipsize, parseJson} from "@welshman/lib"
import {CustomEvent} from "./Events"
import {TrustedEvent} from "./Events"
import {PROFILE} from "./Kinds"
export type Profile = {
@@ -13,11 +13,11 @@ export type Profile = {
picture?: string
website?: string
display_name?: string
event?: CustomEvent
event?: TrustedEvent
}
export type PublishedProfile = Omit<Profile, "event"> & {
event: CustomEvent
event: TrustedEvent
}
export const isPublishedProfile = (profile: Profile): profile is PublishedProfile =>
@@ -36,7 +36,7 @@ export const makeProfile = (profile: Partial<Profile> = {}): Profile => ({
...profile,
})
export const readProfile = (event: CustomEvent) => {
export const readProfile = (event: TrustedEvent) => {
const profile = parseJson(event.content) || {}
return {...profile, event} as PublishedProfile