diff --git a/src/index.ts b/src/index.ts index 400567e..f6e7b3c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -10,8 +10,8 @@ const sortable = [ 'top' ]; -export default async function randomBunny(subreddit: string, sortBy?: string): Promise { - if (!sortBy || !sortable.includes(sortBy)) sortBy = 'hot'; +export default async function randomBunny(subreddit: string, sortBy: string = 'hot'): Promise { + if (!sortable.includes(sortBy)) sortBy = 'hot'; const result = await fetch(`https://reddit.com/r/${subreddit}/${sortBy}.json`);