Created
October 3, 2019 13:18
-
-
Save borlaym/1757193fbcfb0c74a9619b99e220436f to your computer and use it in GitHub Desktop.
The solution
This file contains hidden or 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
function getKinjaVideoForPost(post: Post): Array<string> { | |
const videoNodes = post.body.reduce<Array<KinjaVideoJSON>>((acc, n) => { | |
if (n.type === 'KinjaVideo') { | |
return [...acc, n]; | |
} | |
return acc; | |
}, []); | |
return videoNodes.map(vn => vn.id); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment