Skip to content

Commit

Permalink
fix lint error.
Browse files Browse the repository at this point in the history
  • Loading branch information
AsaiToshiya authored Oct 31, 2024
1 parent 659ad36 commit 0d23740
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions nip05.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ let _fetch: any

try {
_fetch = fetch
} catch (_) {null}
} catch (_) {
null
}

export function useFetchImplementation(fetchImplementation: unknown) {
_fetch = fetchImplementation
Expand All @@ -28,7 +30,7 @@ export async function searchDomain(domain: string, query = ''): Promise<{ [name:
const url = `https://${domain}/.well-known/nostr.json?name=${query}`
const res = await _fetch(url, { redirect: 'manual' })
if (res.status !== 200) {
throw Error("Wrong response code")
throw Error('Wrong response code')
}
const json = await res.json()
return json.names
Expand All @@ -47,7 +49,7 @@ export async function queryProfile(fullname: string): Promise<ProfilePointer | n
const url = `https://${domain}/.well-known/nostr.json?name=${name}`
const res = await _fetch(url, { redirect: 'manual' })
if (res.status !== 200) {
throw Error("Wrong response code")
throw Error('Wrong response code')
}
const json = await res.json()

Expand Down

0 comments on commit 0d23740

Please sign in to comment.