Skip to content

Commit

Permalink
simplify prefix assignment
Browse files Browse the repository at this point in the history
Co-authored-by: Uzlopak <aras.abbasi@googlemail.com>
  • Loading branch information
gurgunday and Uzlopak committed Sep 6, 2023
1 parent 05d9a01 commit acf0221
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,7 @@ async function fastifyStatic (fastify, opts) {
maxAge: opts.maxAge
}

let prefix = opts.prefix
if (prefix === undefined) {
prefix = (opts.prefix = '/')
}
let prefix = opts.prefix ?? (opts.prefix = '/')

if (!opts.prefixAvoidTrailingSlash) {
prefix =
Expand Down

0 comments on commit acf0221

Please sign in to comment.