forked from lowlighter/metrics
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.mjs
More file actions
28 lines (28 loc) · 956 Bytes
/
index.mjs
File metadata and controls
28 lines (28 loc) · 956 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
//Setup
export default async function ({computed, q}, {enabled = false} = {}) {
//Plugin execution
try {
//Check if plugin is enabled and requirements are met
if ((!enabled)||(!q.followup))
return null
//Define getters
const followup = {
issues:{
get count() { return this.open + this.closed },
get open() { return computed.repositories.issues_open },
get closed() { return computed.repositories.issues_closed },
},
pr:{
get count() { return this.open + this.merged },
get open() { return computed.repositories.pr_open },
get merged() { return computed.repositories.pr_merged }
}
}
//Results
return followup
}
//Handle errors
catch (error) {
throw {error:{message:"An error occured", instance:error}}
}
}