From 321a055d6cf756336be4a952068c957fd3349394 Mon Sep 17 00:00:00 2001 From: Jeremy McIntyre Date: Fri, 1 Nov 2024 15:30:39 -0700 Subject: [PATCH] Add overloads to support passing 1 string arg to renderStatic --- src/PageForServer.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/PageForServer.ts b/src/PageForServer.ts index 85895ebb..d863704c 100644 --- a/src/PageForServer.ts +++ b/src/PageForServer.ts @@ -55,14 +55,16 @@ export class PageForServer extends Page { }); } - renderStatic(status?: number, ns?: string) { + renderStatic(ns: string): void; + renderStatic(status: number, ns?: string): void; + renderStatic(status?: number | string, ns?: string) { if (typeof status !== 'number') { ns = status; status = null; } this.app.emit('renderStatic', this); - if (status) this.res.statusCode = status; + if (typeof status === 'number') this.res.statusCode = status; this.params = pageParams(this.req); this._setRenderParams(ns); const pageHtml = this.get('Page', ns);