refactor: replace short hand type conversions with function calls

Prefer using explicit casts by calling `Number`, `Boolean`, or `String` over using operators like `+`, `!!` or `"" +`. This is considered best practice as it improves readability.
This commit is contained in:
deepsource-autofix[bot] 2024-05-25 10:10:15 +00:00 committed by GitHub
parent b99142fd44
commit 5228c0e1d0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -6,6 +6,6 @@ export async function getPosts(collection: keyof ContentEntryMap) {
return data.draft !== true return data.draft !== true
}) })
return posts.sort((a, b) => return posts.sort((a, b) =>
a.data.pubDate && b.data.pubDate ? +b.data.pubDate - +a.data.pubDate : 0 a.data.pubDate && b.data.pubDate ? Number(b.data.pubDate) - Number(a.data.pubDate) : 0
) )
} }