From f3181ca9a55c3470af329c160a58a6b2c3c65e9d Mon Sep 17 00:00:00 2001 From: Toby Date: Thu, 2 Feb 2023 18:31:33 +0100 Subject: [PATCH] change `||` to `??` --- src/index.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/index.ts b/src/index.ts index 03dbebe..55da25c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -287,11 +287,11 @@ export class Router { public cors(config?: RouterCorsConfig): Router { this.corsEnabled = true this.corsConfig = { - allowOrigin: config?.allowOrigin || '*', - allowMethods: config?.allowMethods || '*', - allowHeaders: config?.allowHeaders || '*', - maxAge: config?.maxAge || 86400, - optionsSuccessStatus: config?.optionsSuccessStatus || 204 + allowOrigin: config?.allowOrigin ?? '*', + allowMethods: config?.allowMethods ?? '*', + allowHeaders: config?.allowHeaders ?? '*', + maxAge: config?.maxAge ?? 86400, + optionsSuccessStatus: config?.optionsSuccessStatus ?? 204 } return this }