Skip to content

Commit

Permalink
test(index): replace typeof undefined check (#275)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fdawgs committed Oct 28, 2023
1 parent 7f7f915 commit 57d8084
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 57d8084

Please sign in to comment.