fix lint error.
This commit is contained in:
parent
659ad36b62
commit
0d237405d9
8
nip05.ts
8
nip05.ts
|
@ -17,7 +17,9 @@ let _fetch: any
|
||||||
|
|
||||||
try {
|
try {
|
||||||
_fetch = fetch
|
_fetch = fetch
|
||||||
} catch (_) {null}
|
} catch (_) {
|
||||||
|
null
|
||||||
|
}
|
||||||
|
|
||||||
export function useFetchImplementation(fetchImplementation: unknown) {
|
export function useFetchImplementation(fetchImplementation: unknown) {
|
||||||
_fetch = fetchImplementation
|
_fetch = fetchImplementation
|
||||||
|
@ -28,7 +30,7 @@ export async function searchDomain(domain: string, query = ''): Promise<{ [name:
|
||||||
const url = `https://${domain}/.well-known/nostr.json?name=${query}`
|
const url = `https://${domain}/.well-known/nostr.json?name=${query}`
|
||||||
const res = await _fetch(url, { redirect: 'manual' })
|
const res = await _fetch(url, { redirect: 'manual' })
|
||||||
if (res.status !== 200) {
|
if (res.status !== 200) {
|
||||||
throw Error("Wrong response code")
|
throw Error('Wrong response code')
|
||||||
}
|
}
|
||||||
const json = await res.json()
|
const json = await res.json()
|
||||||
return json.names
|
return json.names
|
||||||
|
@ -47,7 +49,7 @@ export async function queryProfile(fullname: string): Promise<ProfilePointer | n
|
||||||
const url = `https://${domain}/.well-known/nostr.json?name=${name}`
|
const url = `https://${domain}/.well-known/nostr.json?name=${name}`
|
||||||
const res = await _fetch(url, { redirect: 'manual' })
|
const res = await _fetch(url, { redirect: 'manual' })
|
||||||
if (res.status !== 200) {
|
if (res.status !== 200) {
|
||||||
throw Error("Wrong response code")
|
throw Error('Wrong response code')
|
||||||
}
|
}
|
||||||
const json = await res.json()
|
const json = await res.json()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue