Skip to content

Commit

Permalink
perf(index): use optional chaining (#501)
Browse files Browse the repository at this point in the history
Signed-off-by: Frazer Smith <[email protected]>
  • Loading branch information
Fdawgs authored Jan 11, 2025
1 parent ca555e7 commit 055db91
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 @@ -77,7 +77,7 @@ async function fastifyStatic (fastify, opts) {
if (opts.decorateReply !== false) {
fastify.decorateReply('sendFile', function (filePath, rootPath, options) {
const opts = typeof rootPath === 'object' ? rootPath : options
const root = typeof rootPath === 'string' ? rootPath : opts && opts.root
const root = typeof rootPath === 'string' ? rootPath : opts?.root
pumpSendToReply(
this.request,
this,
Expand Down

0 comments on commit 055db91

Please sign in to comment.