constrawPostJson=getRawJson('~/path/to/post_data.json');constrawCommentJson=getRawJson('~/path/to/comment_data.json');constmySchema=getRawJson('~/path/to/schema.json');//starts empty maybe?constjsonGraphData=getRawJson('~/path/to/graphData.json')// returns functions for the different types allowed by the schema, with the destination file baked inconst{addPoster,addPost,addCharacter}=schemaFiller.fromSchema(mySchema,jsonGraphData);constextractedPosts=doSomethingClever(rawPostJson).map(post=>{author,url,character,subtype});constextractedComments=doSomethingElseClever(rawCommentJson).map(post=>{author,url,character,subtype});extractedPosts.forEach(post=>{// converts subtype from LFA/RF to Requester/ArtistaddPoster(post.author,post.url,post.subtype);addPost(post.author,post.url,post.character,post.subtype);// converts subtype from LFA/RF to Owner/ArtistaddCharacter(post.author,post.subtype);});extractedComments.forEach(comment=>{// converts subtype from LFA/RF to Requester/ArtistaddPoster(comment.author,comment.url,comment.subtype);addPost(comment.author,post.url,post.character,post.subtype);// converts subtype from LFA/RF to Owner/ArtistaddCharacter(comment.author,comment.subtype);});schemaFiller.writeToFile(addPoster,addPost,addCharacter);
Warning
LINK
You are about to visit a link which has been flagged with the above content warnings. Do you wish to continue?