From a6f29408900ce074159fbf2e6ac2c16de9c6d570 Mon Sep 17 00:00:00 2001 From: Ayoub-Mabrouk Date: Thu, 31 Oct 2024 01:57:03 +0100 Subject: [PATCH] Refactor typeChecker function for conciseness and modern syntax - Replaced traditional function declaration with an arrow function for brevity - Utilized implicit return to streamline the code - Enhanced readability while maintaining functionality --- lib/types/json.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/types/json.js b/lib/types/json.js index bc2de83..901b16c 100644 --- a/lib/types/json.js +++ b/lib/types/json.js @@ -241,7 +241,5 @@ function normalizeJsonSyntaxError (error, obj) { */ function typeChecker (type) { - return function checkType (req) { - return Boolean(typeis(req, type)) - } + return (req) => Boolean(typeis(req, type)) }