Skip to content

Commit

Permalink
Refactor typeChecker function for conciseness and modern syntax
Browse files Browse the repository at this point in the history
- Replaced traditional function declaration with an arrow function for brevity
- Utilized implicit return to streamline the code
- Enhanced readability while maintaining functionality
  • Loading branch information
Ayoub-Mabrouk committed Oct 31, 2024
1 parent aec6065 commit a6f2940
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/types/json.js
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}

0 comments on commit a6f2940

Please sign in to comment.