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

Windows-friendly handler file names #2

Merged
merged 4 commits into from
Sep 14, 2018
Merged

Windows-friendly handler file names #2

merged 4 commits into from
Sep 14, 2018

Conversation

spcfran
Copy link
Contributor

@spcfran spcfran commented Sep 13, 2018

as per #1

Also renamed route to routeFileName to make it clear it does not refer to the routes in express, and added some doc

deconstruct.js Outdated
const pathParameterFlag = ':';

if (typeof options === 'object') {
routeDir = options.routeDir;
Copy link
Owner

Choose a reason for hiding this comment

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

Would you handle the case where options.routeDir is undefined? Throwing is ok for now, I think.

Copy link
Owner

Choose a reason for hiding this comment

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

Another thing: Will this actually work? Will JS allow you to change the value of a const?

Copy link
Owner

Choose a reason for hiding this comment

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

how about:
const routeDir = (typeof options === 'string') ? (options || 'routes') : (options.routeDir || 'routes');

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Another thing: Will this actually work? Will JS allow you to change the value of a const?

I got so used to rely on eslint/typescript in other projects that I didn't even notice until that errored at runtime :)

@adriaan-pelzer adriaan-pelzer merged commit 347f8ee into adriaan-pelzer:master Sep 14, 2018
@spcfran
Copy link
Contributor Author

spcfran commented Sep 14, 2018

Closes #1

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.

2 participants