-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplayground.js
73 lines (72 loc) · 1.91 KB
/
playground.js
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
const data = [
{
id: '7694690781',
type: 'WatchEvent',
actor: {
id: 11282659,
login: 'theomjones',
display_login: 'theomjones',
gravatar_id: '',
url: 'https://api.github.com/users/theomjones',
avatar_url: 'https://avatars.githubusercontent.com/u/11282659?',
},
repo: {
id: 126376543,
name: 'walteribeiro/full-react-snippets',
url: 'https://api.github.com/repos/walteribeiro/full-react-snippets',
},
payload: {
action: 'started',
},
public: true,
created_at: '2018-05-18T09:34:53Z',
},
{
id: '7684461042',
type: 'PushEvent',
actor: {
id: 11282659,
login: 'theomjones',
display_login: 'theomjones',
gravatar_id: '',
url: 'https://api.github.com/users/theomjones',
avatar_url: 'https://avatars.githubusercontent.com/u/11282659?',
},
repo: {
id: 133685219,
name: 'theomjones/react-webpack-starter',
url: 'https://api.github.com/repos/theomjones/react-webpack-starter',
},
payload: {
push_id: 2569472182,
size: 1,
distinct_size: 1,
ref: 'refs/heads/master',
head: '76319c06f06add694d543c334e697659b1475be3',
before: 'fbdc1aec55340bfa7cd42c02d384db92bbd8f52b',
commits: [
{
sha: '76319c06f06add694d543c334e697659b1475be3',
author: {
email: '[email protected]',
name: 'Theo M Jones',
},
message: 'added page creator',
distinct: true,
url:
'https://api.github.com/repos/theomjones/react-webpack-starter/commits/76319c06f06add694d543c334e697659b1475be3',
},
],
},
public: true,
created_at: '2018-05-16T16:23:25Z',
},
]
const parseData = data => {
return data.map(item => ({
action: item.payload.action,
url: item.repo.url,
time: item.created_at,
name: item.repo.name,
}))
}