export function upsertSocketComment(comments, incoming) {
    const updated = [...comments];
    const index = updated.findIndex((comment) => comment.id === incoming.id);
    if (index !== -1) {
        updated[index] = incoming;
        return updated;
    }
    return [...updated, incoming];
}
export function removeSuggestionAndLinkedComments(suggestions, comments, suggestedEditId) {
    return {
        suggestions: suggestions.filter((suggestion) => suggestion.id !== suggestedEditId),
        comments: comments.filter((comment) => comment.suggestedEditId !== suggestedEditId),
    };
}
//# sourceMappingURL=feedbackSocketState.js.map