Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/github.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module.exports = function( Release ) {
Release.define({
_githubApiPath: function( path ) {
var repoUrl = Release._packageUrl( "bugs" );
var repo = repoUrl.match( /github\.com\/(\w+\/\w+)/ )[ 1 ];
var repo = repoUrl.match( /github\.com\/([^/]+\/[^/]+)/ )[ 1 ];
Copy link
Member

Choose a reason for hiding this comment

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

We can also use something like this – https://github.com/jonschlinkert/parse-github-url

Right?

Copy link
Member

Choose a reason for hiding this comment

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

I'd rather look at this one-line regexp that's super clear for the case we care about than deal with a 143-line dependency that solves a much more general problem and seems to be unmaintained. Also, this regexp allows repos with leading special chars and that package does not.

Copy link
Member

Choose a reason for hiding this comment

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

Agreed. I prefer the regex.

Copy link
Member

Choose a reason for hiding this comment

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

Wow, a lot of arguments against, haha

return "/repos/" + repo + "/" + path;
},

Expand Down