Move search to its own file, validate and search by nip05
This commit is contained in:
@@ -4,7 +4,6 @@ import {ctx, groupBy, indexBy, batch, now, uniq, batcher, postJson} from '@welsh
|
||||
import type {RelayProfile} from "@welshman/util"
|
||||
import {normalizeRelayUrl} from "@welshman/util"
|
||||
import {AuthStatus, asMessage, type Connection, type SocketMessage} from '@welshman/net'
|
||||
import {createSearch} from './util'
|
||||
import {collection} from './collection'
|
||||
|
||||
export type RelayStats = {
|
||||
@@ -89,15 +88,6 @@ export const {
|
||||
}),
|
||||
})
|
||||
|
||||
export const relaySearch = derived(relays, $relays =>
|
||||
createSearch($relays, {
|
||||
getValue: (relay: Relay) => relay.url,
|
||||
fuseOptions: {
|
||||
keys: ["url", "name", {name: "description", weight: 0.3}],
|
||||
},
|
||||
}),
|
||||
)
|
||||
|
||||
// Utilities for syncing stats from connections to relays
|
||||
|
||||
type RelayStatsUpdate = [string, (stats: RelayStats) => void]
|
||||
|
||||
Reference in New Issue
Block a user