Skip to content

Commit

Permalink
perf(index): use spread over object.assign (#257)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fdawgs authored Jul 20, 2023
1 parent 44a365c commit a7d0a62
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ function handleCorsOptionsCallbackDelegator (optionsResolver, fastify, req, repl
* @param {import('./types').FastifyCorsOptions} opts
*/
function normalizeCorsOptions (opts) {
const corsOptions = Object.assign({}, defaultOptions, opts)
const corsOptions = { ...defaultOptions, ...opts }
if (Array.isArray(opts.origin) && opts.origin.indexOf('*') !== -1) {
corsOptions.origin = '*'
}
Expand Down

0 comments on commit a7d0a62

Please sign in to comment.