Handle empty tags in repository, tweak dvm types
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@welshman/dvm",
|
||||
"version": "0.0.1",
|
||||
"version": "0.0.2",
|
||||
"author": "hodlbod",
|
||||
"license": "MIT",
|
||||
"description": "A collection of utilities for building nostr DVMs.",
|
||||
@@ -33,7 +33,7 @@
|
||||
"dependencies": {
|
||||
"@welshman/lib": "0.0.11",
|
||||
"@welshman/net": "0.0.14",
|
||||
"@welshman/util": "0.0.18",
|
||||
"@welshman/util": "0.0.19",
|
||||
"nostr-tools": "^2.7.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,13 +16,14 @@ export type DVMRequestOptions = {
|
||||
reportProgress?: boolean
|
||||
}
|
||||
|
||||
export type DVMRequest = DVMRequestOptions & {
|
||||
export type DVMRequest = {
|
||||
request: DVMRequestOptions
|
||||
emitter: Emitter,
|
||||
sub: Subscription
|
||||
pub: Publish
|
||||
}
|
||||
|
||||
export const makeDvmRequest = (request: DVMRequest) => {
|
||||
export const makeDvmRequest = (request: DVMRequestOptions) => {
|
||||
const emitter = new Emitter()
|
||||
const {event, relays, timeout = 30_000, autoClose = true, reportProgress = true} = request
|
||||
const kind = event.kind + 1000
|
||||
@@ -43,5 +44,5 @@ export const makeDvmRequest = (request: DVMRequest) => {
|
||||
}
|
||||
})
|
||||
|
||||
return {request, emitter, sub, pub}
|
||||
return {request, emitter, sub, pub} as DVMRequest
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user