-
Notifications
You must be signed in to change notification settings - Fork 103
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
Properly parse urls without "//" after the protocol #22
Conversation
var url = this; | ||
|
||
if ('query' === part) { | ||
if (fnOrNoSlashes && 'function' !== typeof fnOrNoSlashes) { |
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 would not add this, it will throw an error anyway if the given argument is not function.
It will save few bytes on the browser.
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
Left some comments but LGTM. It would be nice to have another pair of eyes here anyway. |
@@ -29,6 +29,19 @@ var instructions = [ | |||
]; | |||
|
|||
/** | |||
* Extract protocol information from a URL | |||
* Correctly extracts protocols with/without double slash ("//"); |
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.
Could you JSDoc comment this function? So it documented what it returns, and what the function expects to receive?
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 is meant to be an internal/private function not exposed in the API. I can still use JSDoc for it I guess
Minor comments, but LGTM otherwise |
Made the suggested changes. @lpinca I left the |
* Extract protocol information from a URL with/without double slash ("//") | ||
* | ||
* @param {String} address URL we want to extract from. | ||
* @return {ProtocolExtract} Extracted information |
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 was ok with just Object
but thanks for the effort.
👍 |
Ill release a new minor in a bit. Thanks for your contribution |
No problem. Happy to help. |
This test fails on IE, we need to fix it. |
Yes. Just seeing it. It has to do with the expected error message. |
On my way. |
End of this line can probably be changed to |
Published as 1.1.0 |
Fixes issue #8