Update linter and fix code style

This commit is contained in:
Djuri 2024-09-03 11:37:34 +02:00
parent 5594355b4c
commit 7b6a8cf10b
7 changed files with 101 additions and 133 deletions

View file

@ -12,7 +12,7 @@ const isValidNpub = (npub: string): boolean => {
const { type, data } = nip19.decode(npub);
// Check if the type is 'npub' and the data length is 32 bytes
return type === 'npub' && data.length === 64;
} catch (e) {
} catch {
// If any error is thrown, the npub is not valid
return false;
}
@ -35,7 +35,7 @@ const isValidNostrRelay = async (url: string): Promise<boolean> => {
}
return false;
} catch (e) {
} catch {
// If any error is thrown, the URL is not a valid Nostr relay
return false;
}
@ -72,7 +72,7 @@ const getPubKey = (input: string): string | null => {
}
return null;
} catch (e) {
} catch {
// If any error is thrown, the input is not valid
return null;
}

View file

@ -46,7 +46,7 @@
if ($locale) {
let newLanguageNames = new Intl.DisplayNames([$locale], { type: 'language' });
for (let l: string of $locales) {
for (let l of $locales) {
languageNames[l] = newLanguageNames.of(l);
}
}