Skip to content
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

Merged
merged 5 commits into from
Nov 22, 2018

Conversation

juno-yu
Copy link
Contributor

@juno-yu juno-yu commented Oct 16, 2018

A preminilary impl which resolves #2

(Sorry got a bug, async WIP)

@codecov
Copy link

codecov bot commented Oct 16, 2018

Codecov Report

Merging #7 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master     #7   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           2      2           
  Lines          19     22    +3     
  Branches        4      5    +1     
=====================================
+ Hits           19     22    +3
Impacted Files Coverage Δ
lib/middleware.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 53db34f...c7fba4d. Read the comment docs.

@manniL
Copy link
Member

manniL commented Oct 16, 2018

Hey @juno-yu! Thanks for the PR and well done! I've added a small annotation with regards to async/await ☺️

// 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)
Copy link
Member

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 awaited for in case it's async!

@manniL
Copy link
Member

manniL commented Oct 16, 2018

@juno-yu Alright, almost good to go! Could you update the README as well? 🙊

@manniL
Copy link
Member

manniL commented Oct 26, 2018

@juno-yu ping ☺️

@manniL manniL merged commit 9ed5407 into nuxt-community:master Nov 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Accept function for the to parameter
3 participants