From e2c4ae64d4548aa89b781aeaf51f71b32bf9f608 Mon Sep 17 00:00:00 2001 From: Frazer Smith Date: Sat, 19 Oct 2024 10:39:22 +0100 Subject: [PATCH] refactor(index): use `Object.hasOwn()` (#192) Signed-off-by: Frazer Smith --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 004dbfe..d5e3108 100644 --- a/index.js +++ b/index.js @@ -8,7 +8,7 @@ function fastifyBearerAuth (fastify, options, done) { options = { addHook: true, verifyErrorLogLevel: 'error', ...options } if ( - Object.prototype.hasOwnProperty.call(fastify.log, 'error') === false || + Object.hasOwn(fastify.log, 'error') === false || typeof fastify.log.error !== 'function' ) { options.verifyErrorLogLevel = null @@ -18,7 +18,7 @@ function fastifyBearerAuth (fastify, options, done) { options.verifyErrorLogLevel != null && ( typeof options.verifyErrorLogLevel !== 'string' || - Object.prototype.hasOwnProperty.call(fastify.log, options.verifyErrorLogLevel) === false || + Object.hasOwn(fastify.log, options.verifyErrorLogLevel) === false || typeof fastify.log[options.verifyErrorLogLevel] !== 'function' ) ) {