fix: use includes and toLowerCase in status endpoint (#352)

* fix: close #350

Signed-off-by: Charlike Mike Reagent <opensource@tunnckocore.com>

* use toLowerCase for st.context

Signed-off-by: Charlike Mike Reagent <opensource@tunnckocore.com>
pull/407/head
Charlike Mike Reagent 2020-06-06 10:45:10 +03:00 zatwierdzone przez GitHub
rodzic c869db83d2
commit 903a9e4406
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -104,7 +104,7 @@ async function status ({ owner, repo, ref = 'master', context }: PathArgs) {
const resp = await restGithub(`repos/${owner}/${repo}/commits/${ref}/status`)
let state = typeof context === 'string'
? resp!.statuses.filter(st => st.context.startsWith(context))
? resp!.statuses.filter(st => st.context.toLowerCase().includes(context.toLowerCase()))
: resp!.state
if (Array.isArray(state)) {