-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
fix(redirects): handle non-verbatim targets #9089
Conversation
🦋 Changeset detectedLatest commit: 5689425 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@@ -20,6 +20,7 @@ export function redirectRouteGenerate(redirectRoute: RouteData, data: Params): s | |||
if (typeof routeData !== 'undefined') { | |||
return routeData?.generate(data) || routeData?.pathname || '/'; | |||
} else if (typeof route === 'string') { | |||
console.log({ data, pattern: route}); |
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.
@lilnasy what's the status of this PR? Did you encounter some blocker? |
It's just here to explain the code path that goes wrong. |
for (const param in data) { | ||
const paramValue = data[param]! |
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.
nit: I don't like very much the use of for..in
, we should use for..of
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.
its not an array
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.
const dataAsArray =Object.entries(data);
if (dataAsArray.length > 0) {
for (const t of dataAsArray) {}
}
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.
oh didnt see this, implemented using object.keys
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.
LGTM! Thanks for the fix
Changes
Testing
Docs
Does not affect usage.