Refactor proxyTag function names

This commit is contained in:
Vitor Pamplona 2025-01-15 09:56:15 -05:00
parent 1f9aeddb57
commit 4a4f03c12b
3 changed files with 8 additions and 6 deletions

View File

@ -22,8 +22,8 @@ package com.vitorpamplona.quartz.nip48ProxyTags
import com.vitorpamplona.quartz.nip01Core.core.Event
fun Event.taggedProxies() = tags.taggedProxies()
fun Event.taggedProxies() = tags.proxies()
fun Event.firstTaggedProxy() = tags.firstTaggedProxy()
fun Event.firstTaggedProxy() = tags.firstProxy()
fun Event.hasAnyTaggedProxy() = tags.hasAnyTaggedProxy()
fun Event.hasTaggedProxy() = tags.hasProxy()

View File

@ -31,3 +31,5 @@ fun TagArrayBuilder.proxy(
id: String,
pt: String,
) = add(ProxyTag.assemble(id, pt))
fun TagArrayBuilder.proxy(tag: ProxyTag) = add(tag.toTagArray())

View File

@ -25,8 +25,8 @@ import com.vitorpamplona.quartz.nip01Core.core.firstTagValue
import com.vitorpamplona.quartz.nip01Core.core.hasTagWithContent
import com.vitorpamplona.quartz.nip01Core.core.mapValues
fun TagArray.taggedProxies() = this.mapValues(ProxyTag.TAG_NAME)
fun TagArray.proxies() = this.mapValues(ProxyTag.TAG_NAME)
fun TagArray.firstTaggedProxy() = this.firstTagValue(ProxyTag.TAG_NAME)
fun TagArray.firstProxy() = this.firstTagValue(ProxyTag.TAG_NAME)
fun TagArray.hasAnyTaggedProxy() = this.hasTagWithContent(ProxyTag.TAG_NAME)
fun TagArray.hasProxy() = this.hasTagWithContent(ProxyTag.TAG_NAME)