Created
November 8, 2019 23:49
-
-
Save volpeo/6120cf167fad3323d4a1142704b3f61a to your computer and use it in GitHub Desktop.
Jato.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data = request_result | |
// target the array of projects | |
projects = request_result.data.projects.group | |
// target the array of repos | |
repos = data.data.repo.edges | |
// get the strings we need to filter on as source | |
source = repos.map(function(repo) { return repo.node.relativePath }) | |
// filter on projects | |
projects.filter(function(project) { | |
// return true if relativeDirectory of project is in the array of the source strings | |
return source.includes(project.edges[0].node.relativeDirectory) | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"edges": [ | |
{ | |
"node": { | |
"publicURL": "/static/Aleyna-3f3a4b1c7761ad2cf6f9ea748d45e43c.jpg", | |
"relativeDirectory": "Logos", | |
"sourceInstanceName": "Design" | |
} | |
} | |
] | |
}, | |
{ | |
"edges": [ | |
{ | |
"node": { | |
"publicURL": "/static/bouille2mome-3-89bd292a63902adb7385737cf9062ffd.jpg", | |
"relativeDirectory": "Love", | |
"sourceInstanceName": "Photography" | |
} | |
} | |
] | |
}, | |
{ | |
"edges": [ | |
{ | |
"node": { | |
"publicURL": "/static/new-sydney-life-c6234718d269fb13854f2bfbfc60ba7a.jpg", | |
"relativeDirectory": "Personal", | |
"sourceInstanceName": "Design" | |
} | |
} | |
] | |
} | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment