From 63def1d62c5106c004768e29a6fb5416e02a94ed Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 26 Aug 2023 12:58:17 -0500 Subject: [PATCH] utils: add return types (to improve readability) --- src/utils.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils.ts b/src/utils.ts index 44dff18..7f47f31 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -3,12 +3,12 @@ import { lookupNip05Cached } from '@/nip05.ts'; import { getAuthor } from '@/queries.ts'; /** Get the current time in Nostr format. */ -const nostrNow = () => Math.floor(Date.now() / 1000); +const nostrNow = (): number => Math.floor(Date.now() / 1000); /** Convenience function to convert Nostr dates into native Date objects. */ -const nostrDate = (seconds: number) => new Date(seconds * 1000); +const nostrDate = (seconds: number): Date => new Date(seconds * 1000); /** Pass to sort() to sort events by date. */ -const eventDateComparator = (a: Event, b: Event) => b.created_at - a.created_at; +const eventDateComparator = (a: Event, b: Event): number => b.created_at - a.created_at; /** Get pubkey from bech32 string, if applicable. */ function bech32ToPubkey(bech32: string): string | undefined {