Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ function fastifyWebsocket (fastify, opts, next) {
}

let preClose = defaultPreClose
if (opts && opts.preClose) {
if (opts?.preClose) {
if (typeof opts.preClose !== 'function') {
return next(new Error('invalid preClose function'))
}

preClose = opts.preClose
}

if (opts.options && opts.options.noServer) {
if (opts.options?.noServer) {
return next(new Error("fastify-websocket doesn't support the ws noServer option. If you want to create a websocket server detatched from fastify, use the ws library directly."))
}

Expand Down
Loading