Skip to content

Commit 055db91

Browse files
authored
perf(index): use optional chaining (#501)
Signed-off-by: Frazer Smith <frazer.dev@icloud.com>
1 parent ca555e7 commit 055db91

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ async function fastifyStatic (fastify, opts) {
7777
if (opts.decorateReply !== false) {
7878
fastify.decorateReply('sendFile', function (filePath, rootPath, options) {
7979
const opts = typeof rootPath === 'object' ? rootPath : options
80-
const root = typeof rootPath === 'string' ? rootPath : opts && opts.root
80+
const root = typeof rootPath === 'string' ? rootPath : opts?.root
8181
pumpSendToReply(
8282
this.request,
8383
this,

0 commit comments

Comments
 (0)