git ssb

16+

Dominic / patchbay



Commit 0764edcc78e29358a627ab3614462f998cfdc47b

Simplify getting issue state

Charles Lehner committed on 8/2/2016, 3:00:22 AM
Parent: 4de55198f28a26699cb48dbe58ca2d058e0ebe88

Files changed

modules/git.jschanged
modules/git.jsView
@@ -31,15 +31,14 @@
3131 function getIssueState(id, cb) {
3232 pull(
3333 sbot_links({dest: id, rel: 'issues', values: true, reverse: true}),
3434 pull.map(function (msg) {
35- var issues = msg.value.content.issues
36- if (!Array.isArray(issues)) return
37- return issues.filter(function (issue) {
38- return issue.link === id
39- })
35+ return msg.value.content.issues
4036 }),
4137 pull.flatten(),
38+ pull.filter(function (issue) {
39+ return issue.link === id
40+ }),
4241 pull.map(function (issue) {
4342 return issue.merged ? 'merged' : issue.open ? 'open' : 'closed'
4443 }),
4544 pull.take(1),

Built with git-ssb-web