Stop calling variables "which"; affects [chocolatey codeclimate conda crates debug gem github mozillaobservatory nuget powershellgallery pub resharper vaadindirectory] (#3495)

* which --> variant

* which --> alias

* which --> format

* improve param names in codeclimate

* improve param names in github-issue-detail

* update github-issue-detail unit tests
This commit is contained in:
chris48s
2019-05-28 23:00:12 +01:00
committed by GitHub
parent 52e90af310
commit 65dba94fa8
25 changed files with 175 additions and 175 deletions

View File

@@ -28,7 +28,7 @@ module.exports = class GithubReleaseDate extends GithubAuthService {
static get route() {
return {
base: 'github',
pattern: ':which(release-date|release-date-pre)/:user/:repo',
pattern: ':variant(release-date|release-date-pre)/:user/:repo',
}
}
@@ -71,9 +71,9 @@ module.exports = class GithubReleaseDate extends GithubAuthService {
}
}
async fetch({ which, user, repo }) {
async fetch({ variant, user, repo }) {
const url =
which === 'release-date'
variant === 'release-date'
? `/repos/${user}/${repo}/releases/latest`
: `/repos/${user}/${repo}/releases`
return this._requestJson({
@@ -83,8 +83,8 @@ module.exports = class GithubReleaseDate extends GithubAuthService {
})
}
async handle({ which, user, repo }) {
const body = await this.fetch({ which, user, repo })
async handle({ variant, user, repo }) {
const body = await this.fetch({ variant, user, repo })
if (Array.isArray(body)) {
return this.constructor.render({ date: body[0].created_at })
}