Skip to content

Commit

Permalink
Convert a format to pattern in [githubpackagejson]
Browse files Browse the repository at this point in the history
This now relies on the order in which these are registered, though that seems okay. Exporting them as an array guarantees that.

Ref #3329
  • Loading branch information
paulmelnikow committed Jul 6, 2019
1 parent 66c7f13 commit 1c91721
Showing 1 changed file with 5 additions and 4 deletions.
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,
}
]

0 comments on commit 1c91721

Please sign in to comment.