From 122ac0663fcc7752bf39cecfadd41497fde3d120 Mon Sep 17 00:00:00 2001 From: Frazer Smith Date: Mon, 6 Jan 2025 16:48:11 +0000 Subject: [PATCH] perf(index): use optional chaining Signed-off-by: Frazer Smith --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 168693c..3a44415 100644 --- a/index.js +++ b/index.js @@ -125,7 +125,7 @@ function fastifyPostgres (fastify, options, next) { } fastify.addHook('onRoute', routeOptions => { - const transact = routeOptions && routeOptions.pg && routeOptions.pg.transact + const transact = routeOptions?.pg?.transact if ( !transact ||