From b02d30d085963e06a68f928e71b567bc4ac71825 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcus=20P=C3=B6hls?= Date: Sat, 27 Jan 2024 14:32:55 +0100 Subject: [PATCH] use nullish coalescing --- packages/view/src/drivers/handlebars/handlebars-driver.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/view/src/drivers/handlebars/handlebars-driver.ts b/packages/view/src/drivers/handlebars/handlebars-driver.ts index 667d9142..3969f792 100644 --- a/packages/view/src/drivers/handlebars/handlebars-driver.ts +++ b/packages/view/src/drivers/handlebars/handlebars-driver.ts @@ -280,7 +280,7 @@ export class HandlebarsDriver extends ViewBaseDriver implements ViewEngine { async renderWithLayout (view: string, data: any, viewConfig: ViewResponseConfig): Promise { const layout = await this.compile(this.baseLayout(viewConfig), { isLayout: true }) - const context: any = data || {} + const context: any = data ?? {} context.content = await this.renderView(view, data) return layout(context)