diff --git a/lib/types/json.js b/lib/types/json.js index 30bf8cab..901b16c6 100644 --- a/lib/types/json.js +++ b/lib/types/json.js @@ -189,11 +189,8 @@ function createStrictSyntaxError (str, char) { */ function firstchar (str) { - var match = FIRST_CHAR_REGEXP.exec(str) - - return match - ? match[1] - : undefined + const match = FIRST_CHAR_REGEXP.exec(str) + return match?.[1] } /** @@ -244,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)) }