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

Convert a format to pattern in [githubpackagejson] #3660

Merged
merged 2 commits into from
Jul 7, 2019
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
9 changes: 5 additions & 4 deletions services/github/github-package-json.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ class GithubPackageJsonDependencyVersion extends ConditionalGithubAuthService {
}
}

// This must be exported after GithubPackageJsonVersion in order for the
// former to work correctly.
class DynamicGithubPackageJson extends ConditionalGithubAuthService {
static get category() {
return 'other'
Expand All @@ -179,8 +181,7 @@ class DynamicGithubPackageJson extends ConditionalGithubAuthService {
static get route() {
return {
base: 'github/package-json',
format: '(?!v)([^/]+)/([^/]+)/([^/]+)/?([^/]+)?',
capture: ['key', 'user', 'repo', 'branch'],
pattern: ':key/:user/:repo/:branch*',
}
}

Expand Down Expand Up @@ -252,8 +253,8 @@ class DynamicGithubPackageJson extends ConditionalGithubAuthService {
}
}

module.exports = {
module.exports = [
GithubPackageJsonVersion,
GithubPackageJsonDependencyVersion,
DynamicGithubPackageJson,
}
]