-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Accept to param as function for redirect rule #7
Accept to param as function for redirect rule #7
Conversation
Codecov Report
@@ Coverage Diff @@
## master #7 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 2 2
Lines 19 22 +3
Branches 4 5 +1
=====================================
+ Hits 19 22 +3
Continue to review full report at Codecov.
|
Hey @juno-yu! Thanks for the PR and well done! I've added a small annotation with regards to |
lib/middleware.js
Outdated
// Expect rule 'to' to be 1)regex or 2)string or 3)synchronous function taking from to compute to | ||
let toTarget = foundRule.to | ||
if (typeof toTarget === 'function') { | ||
toTarget = toTarget(foundRule.from) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'd be great if the function could be await
ed for in case it's async!
@juno-yu Alright, almost good to go! Could you update the |
@juno-yu ping |
A preminilary impl which resolves #2
(Sorry got a bug, async WIP)