From 57d808412bc8ab5fad9971075f1e16b8e45f139b Mon Sep 17 00:00:00 2001 From: Frazer Smith Date: Sat, 28 Oct 2023 14:54:11 +0100 Subject: [PATCH] test(index): replace `typeof` undefined check (#275) --- types/index.test-d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/index.test-d.ts b/types/index.test-d.ts index 6e17445..eeb6158 100644 --- a/types/index.test-d.ts +++ b/types/index.test-d.ts @@ -97,7 +97,7 @@ app.register(fastifyCors, { }) const corsDelegate: OriginFunction = (origin, cb) => { - if (typeof origin === 'undefined' || /localhost/.test(origin)) { + if (origin === undefined || /localhost/.test(origin)) { cb(null, true) return } @@ -219,7 +219,7 @@ appHttp2.register(fastifyCors, { appHttp2.register(fastifyCors, { origin: (origin: string | undefined, cb: (err: Error | null, allow: boolean) => void) => { - if (typeof origin === 'undefined' || /localhost/.test(origin)) { + if (origin === undefined || /localhost/.test(origin)) { cb(null, true) return }