Skip to content

Commit

Permalink
test(index): replace typeof undefined check
Browse files Browse the repository at this point in the history
  • Loading branch information
Fdawgs committed Oct 28, 2023
1 parent 7f7f915 commit 0f85903
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions types/index.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 0f85903

Please sign in to comment.