import { fetch } from "https://esm.town/v/std/fetch";
import { extractCommentInfo } from "https://esm.town/v/willthereader/extractCommentInfo";
import { logMessage } from "https://esm.town/v/willthereader/logMessage";
export async function fetchComments(url) {
const response = await fetch(url);
if (!response.ok) {
throw new Error("Network response was not ok " + response.statusText);
}
const data = await response.json();
const commentInfoArray = data.comments.map((comment) => extractCommentInfo(comment));
return commentInfoArray;
}