-
Notifications
You must be signed in to change notification settings - Fork 254
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(scully): replace falsy check with explicit string check to allow root route #276
Conversation
@@ -46,7 +46,7 @@ export const generateAll = async (localBaseFilter = baseFilter) => { | |||
performanceIds.add('Discovery'); | |||
log('Pull in data to create additional routes.'); | |||
const handledRoutes = await addOptionalRoutes( | |||
unhandledRoutes.filter((r: string) => r && r.startsWith(localBaseFilter)) | |||
unhandledRoutes.filter((r: string) => typeof r === 'string' && r.startsWith(localBaseFilter)) |
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.
I am still not sure if this check is needed at all. Maybe it makes sense to just omit it?
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 protects to mistakes in the Scully.config file. so, yes the check is needed. We have no control over the data that is coming from the guess parser, and neither on the config file. If a route is not a string, its pretty safe to ignore it.
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.
That makes sense, thank you.
If you sign the CLA, I can accept this PR. |
I signed it now. |
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 now
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: #275
What is the new behavior?
Does this PR introduce a breaking change?
Other information