This adds TS type checks to the async handler function. This makes sure that:
asyncHandler('foo') results in a compile error,
for asyncHandler((req, res, next) => { … }), the req, res, and next arguments retain their typing (before this PR, they were just typed any, which defeats a great portion of the TS benefits)
This adds TS type checks to the async handler function. This makes sure that:
asyncHandler('foo')
results in a compile error,asyncHandler((req, res, next) => { … })
, thereq
,res
, andnext
arguments retain their typing (before this PR, they were just typedany
, which defeats a great portion of the TS benefits)