wuffle 0.44.0 → 0.44.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,13 +10,47 @@ function filterIssueOrPull(issueOrPull) {
10
10
  module.exports.filterIssueOrPull = filterIssueOrPull;
11
11
 
12
12
 
13
- function filterRepository(githubRepository) {
13
+ function filterCheckRun(checkRun) {
14
+ const {
15
+ status,
16
+ conclusion,
17
+ name,
18
+ html_url
19
+ } = checkRun;
20
+
21
+ return {
22
+ status,
23
+ conclusion,
24
+ name,
25
+ html_url
26
+ };
27
+ }
28
+
29
+
30
+ function filterStatus(status) {
31
+ const {
32
+ context,
33
+ description,
34
+ target_url,
35
+ state
36
+ } = status;
37
+
38
+ return {
39
+ context,
40
+ description,
41
+ target_url,
42
+ state
43
+ };
44
+ }
45
+
46
+
47
+ function filterRepository(repository) {
14
48
 
15
49
  const {
16
50
  name,
17
51
  owner,
18
52
  html_url
19
- } = githubRepository;
53
+ } = repository;
20
54
 
21
55
  return {
22
56
  name,
@@ -28,13 +62,13 @@ function filterRepository(githubRepository) {
28
62
  module.exports.filterRepository = filterRepository;
29
63
 
30
64
 
31
- function filterUser(githubUser) {
65
+ function filterUser(user) {
32
66
 
33
67
  const {
34
68
  login,
35
69
  avatar_url,
36
70
  html_url
37
- } = githubUser;
71
+ } = user;
38
72
 
39
73
  return {
40
74
  login,
@@ -66,12 +100,14 @@ function filterLabel(githubLabel) {
66
100
 
67
101
  const {
68
102
  name,
69
- color
103
+ color,
104
+ column_label
70
105
  } = githubLabel;
71
106
 
72
107
  return {
73
108
  name,
74
- color
109
+ color,
110
+ ...(column_label ? { column_label } : {})
75
111
  };
76
112
  }
77
113
 
@@ -126,7 +162,11 @@ function filterPull(pullRequest) {
126
162
  merged,
127
163
  html_url,
128
164
  pull_request,
129
- links = []
165
+ links = [],
166
+ order,
167
+ column,
168
+ check_runs = [],
169
+ statuses = []
130
170
  } = pullRequest;
131
171
 
132
172
  return {
@@ -135,18 +175,22 @@ function filterPull(pullRequest) {
135
175
  number,
136
176
  state,
137
177
  title,
138
- user: filterUser(user),
178
+ user: user ? filterUser(user) : null,
139
179
  assignees: assignees.map(filterUser),
140
- requested_reviewers: requested_reviewers.map(filterUser),
180
+ requested_reviewers: (requested_reviewers || []).map(filterUser),
141
181
  labels: labels.map(filterLabel),
142
- comments: comments.map(filterComment),
182
+ comments: Array.isArray(comments) ? comments.map(filterComment) : [],
143
183
  milestone: milestone ? filterMilestone(milestone) : null,
144
184
  draft,
145
185
  merged,
146
186
  repository: filterRepository(repository),
147
187
  html_url,
148
188
  pull_request,
149
- links: links.map(filterLink)
189
+ links: links.map(filterLink),
190
+ order,
191
+ column,
192
+ statuses: statuses.map(filterStatus),
193
+ check_runs: check_runs.map(filterCheckRun)
150
194
  };
151
195
  }
152
196
 
@@ -169,7 +213,9 @@ function filterIssue(issue) {
169
213
  repository,
170
214
  pull_request,
171
215
  comments = [],
172
- links = []
216
+ links = [],
217
+ order,
218
+ column
173
219
  } = issue;
174
220
 
175
221
  return {
@@ -178,15 +224,17 @@ function filterIssue(issue) {
178
224
  number,
179
225
  state,
180
226
  title,
181
- user: filterUser(user),
227
+ user: user ? filterUser(user) : null,
182
228
  assignees: assignees.map(filterUser),
183
229
  labels: labels.map(filterLabel),
184
230
  milestone: milestone ? filterMilestone(milestone) : null,
185
231
  repository: filterRepository(repository),
186
- comments: comments.map(filterComment),
232
+ comments: Array.isArray(comments) ? comments.map(filterComment) : [],
187
233
  pull_request,
188
234
  html_url,
189
- links: links.map(filterLink)
235
+ links: links.map(filterLink),
236
+ order,
237
+ column
190
238
  };
191
239
 
192
240
  }