change || to ??
This commit is contained in:
10
src/index.ts
10
src/index.ts
@@ -287,11 +287,11 @@ export class Router<TEnv = any, TExt = any> {
|
|||||||
public cors(config?: RouterCorsConfig): Router<TEnv, TExt> {
|
public cors(config?: RouterCorsConfig): Router<TEnv, TExt> {
|
||||||
this.corsEnabled = true
|
this.corsEnabled = true
|
||||||
this.corsConfig = {
|
this.corsConfig = {
|
||||||
allowOrigin: config?.allowOrigin || '*',
|
allowOrigin: config?.allowOrigin ?? '*',
|
||||||
allowMethods: config?.allowMethods || '*',
|
allowMethods: config?.allowMethods ?? '*',
|
||||||
allowHeaders: config?.allowHeaders || '*',
|
allowHeaders: config?.allowHeaders ?? '*',
|
||||||
maxAge: config?.maxAge || 86400,
|
maxAge: config?.maxAge ?? 86400,
|
||||||
optionsSuccessStatus: config?.optionsSuccessStatus || 204
|
optionsSuccessStatus: config?.optionsSuccessStatus ?? 204
|
||||||
}
|
}
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user