used coalescing operator to ensure string return in devlog posts
This commit is contained in:
@@ -6,9 +6,9 @@ export async function load({ params }) {
|
|||||||
const tag: string = params.slug;
|
const tag: string = params.slug;
|
||||||
const postValues = posts.get(tag);
|
const postValues = posts.get(tag);
|
||||||
const content = post.default;
|
const content = post.default;
|
||||||
const title = postValues?.title;
|
const title: string = postValues?.title ?? "";
|
||||||
const date = postValues?.date;
|
const date: string = postValues?.date ?? "";
|
||||||
const bannerAlt = postValues?.bannerAlt;
|
const bannerAlt: string = postValues?.bannerAlt ?? "";
|
||||||
|
|
||||||
return {
|
return {
|
||||||
content,
|
content,
|
||||||
|
|||||||
Reference in New Issue
Block a user