-
-
Notifications
You must be signed in to change notification settings - Fork 108
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
refactor: initialize this.path
with path
#123
base: master
Are you sure you want to change the base?
Conversation
@@ -40,7 +40,7 @@ function Layer (path, options, fn) { | |||
this.keys = [] | |||
this.name = fn.name || '<anonymous>' | |||
this.params = undefined | |||
this.path = undefined | |||
this.path = path |
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 think this property is expected to contain the matched path
and not the possible array of paths of the 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.
Agreed, IIRC the idea here is that it is undefined
until matched, then is also unset. You can see this in .match
. I am pretty sure that means this would break the intended behavior.
@@ -40,7 +40,7 @@ function Layer (path, options, fn) { | |||
this.keys = [] | |||
this.name = fn.name || '<anonymous>' | |||
this.params = undefined | |||
this.path = undefined | |||
this.path = path |
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.
Agreed, IIRC the idea here is that it is undefined
until matched, then is also unset. You can see this in .match
. I am pretty sure that means this would break the intended behavior.
this.path
set to undefined instead ofpath
? #122