Skip to content

Commit

Permalink
Fix standard linting
Browse files Browse the repository at this point in the history
  • Loading branch information
Gordey Doronin committed Apr 21, 2021
1 parent b917c70 commit fdcaded
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ module.exports = function (repoUrl, opts) {
if (!hostname) return null
if (hostname !== 'github.com' && hostname !== 'www.github.com' && !opts.enterprise) return null

var parts = pathname.match(/^\/([\w-_]+)\/([\w-_\.]+)(\/tree\/[\%\w-_\.\/]+)?(\/blob\/[\%\w-_\.\/]+)?/)
var parts = pathname.match(/^\/([\w-_]+)\/([\w-_\.]+)(\/tree\/[%\w-_\.\/]+)?(\/blob\/[%\w-_\.\/]+)?/)
// ([\w-_\.]+)
if (!parts) return null
obj.user = parts[1]
Expand All @@ -57,10 +57,10 @@ module.exports = function (repoUrl, opts) {
obj.branch = 'master'
obj.path = parts[3].replace(/\/$/, '')
} else if (parts[3]) {
var branchMatch = parts[3].replace(/^\/tree\//, '').match(/[\%\w-_.]*\/?[\%\w-_]+/)
const branchMatch = parts[3].replace(/^\/tree\//, '').match(/[%\w-_.]*\/?[%\w-_]+/)
obj.branch = branchMatch && branchMatch[0]
} else if (parts[4]) {
var branchMatch = parts[4].replace(/^\/blob\//, '').match(/[\%\w-_.]*\/?[\%\w-_]+/)
const branchMatch = parts[4].replace(/^\/blob\//, '').match(/[%\w-_.]*\/?[%\w-_]+/)
obj.branch = branchMatch && branchMatch[0]
} else {
obj.branch = 'master'
Expand Down

0 comments on commit fdcaded

Please sign in to comment.