-
Notifications
You must be signed in to change notification settings - Fork 46
Expand file tree
/
Copy pathdemo.js
More file actions
28 lines (25 loc) · 741 Bytes
/
demo.js
File metadata and controls
28 lines (25 loc) · 741 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
const persons = require('./content/persons.json')
let activeMentorships = require('./content/activeMentorships.json')
activeMentorships = activeMentorships.mentorships
persons.map((person) => {
person.mentorships = activeMentorships.filter((mentorship) => {
if (mentorship.mentor.endsWith(person.slug)) {
return mentorship
}
})
person.contributions = activeMentorships.filter((mentorship) => {
const gh = person.github
console.log(gh)
if (gh) {
const amIExists = mentorship.contributors.find((contributor) => {
if (contributor.github_address === gh) {
return contributor
}
})
if (amIExists) {
return mentorship
}
}
})
})
console.log(persons)