hoangvvo / next-connect

The TypeScript-ready, minimal router and middleware layer for Next.js, Micro, Vercel, or Node.js http/http2
https://www.npmjs.com/package/next-connect
MIT License
1.62k stars 65 forks source link

Possible regression away from express API #161

Open jimisaacs opened 2 years ago

jimisaacs commented 2 years ago

So before this commit: https://github.com/hoangvvo/next-connect/commit/b3fede17e1bc78cec2d00392301c0a97463fe1fb

an API consumer was passing an array of functions as base without a problem. As this documentation shows should be allowed, if this is a drop-in replacement for express: https://expressjs.com/en/api.html#app.use

A string representing a path. A path pattern. A regular expression pattern to match paths. An array of combinations of any of the above.

Though checking for function breaks that contract, and is breaking the API consumer I mentioned after this change.