tinyhttp/milliparsec

Tinyhttp error in types

theoparis opened this issue · 2 comments

I have tried to use json() with tinyhttp but it says nextfunction | undefined isnt assignable to nextfunction.

A workaround would be

// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
app.use([(req, res, next) => bodyParser.json()(req, res, next!), logger()]);

Which makes sure next function is defnitely defined, however this isn't the best solution to fixing this.

What solution would you propose?

Can't reproduce, so closing