Fixed YAML index file parser failing on duplicate keys.

This commit is contained in:
2024-09-11 05:16:58 +02:00
parent aec5ce292d
commit afaa428fec
3 changed files with 10 additions and 5 deletions

View File

@@ -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);