express-unless icon indicating copy to clipboard operation
express-unless copied to clipboard

Update express-unless with new types

Open sylhare opened this issue 2 years ago • 0 comments

Hello @jfromaniello,

Here is a proposition to refresh the project in typescript, I have:

  • Added a new UnlessRequestHandler type (so it can be used outside of this package)
  • updated some variable name
  • extracted the result into a method
  • Use some smaller notation (like anonymous function and ternary operator)
  • Return next() or middleware() to handle asynchronous behaviour

I was thinking Params could be named UnlessOptions but didn't want to make a breaking change there.

Let me know what you think

All tests are passing: image

sylhare avatar May 24 '23 20:05 sylhare