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

fix(scully): replace falsy check with explicit string check to allow root route #276

Merged
merged 1 commit into from
Feb 5, 2020
Merged

Conversation

BlindDespair
Copy link
Contributor

@BlindDespair BlindDespair commented Feb 4, 2020

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Other... Please describe:

What is the current behavior?

Issue Number: #275

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@BlindDespair BlindDespair changed the title fix: replace falsy check with explicit string check to allow root route fix(scully): replace falsy check with explicit string check to allow root route Feb 4, 2020
@claassistantio
Copy link

claassistantio commented Feb 4, 2020

CLA assistant check
All committers have signed the CLA.

@@ -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))
Copy link
Contributor Author

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?

Copy link
Contributor

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.

Copy link
Contributor Author

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.

@SanderElias
Copy link
Contributor

If you sign the CLA, I can accept this PR.

@BlindDespair
Copy link
Contributor Author

If you sign the CLA, I can accept this PR.

I signed it now.

Copy link
Contributor

@SanderElias SanderElias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM now

@SanderElias SanderElias merged commit 75543eb into scullyio:master Feb 5, 2020
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.

3 participants