Fixed YAML index file parser failing on duplicate keys.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
function curateComments(comments) {
|
||||
return comments.map(comment => ({
|
||||
return comments.map((comment) => ({
|
||||
id: comment.id,
|
||||
url: `https://reddit.com${comment.permalink}`,
|
||||
author: comment.author.name,
|
||||
@@ -31,7 +31,7 @@ async function getFullPost(postId, reddit) {
|
||||
.fetch();
|
||||
}
|
||||
|
||||
async function self(host, originalPost, reddit) {
|
||||
async function self(host, originalPost, { reddit }) {
|
||||
const post = await getFullPost(originalPost.id, reddit) || originalPost;
|
||||
const curatedComments = curateComments(post.comments);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user