src/utils/formatters/single-post-formatter.js
Function singlePostFormatter
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports.singlePostFormatter = async function singlePostFormatter(postData) {
const poster = await getActiveUserFromCache(postData.details.created_by.id);
// Owner means the website owner who create article in index page
const isPosterSiteOwner = username === poster.username.slice(1); // poster.username begins with `@`
const { title, views, like_count: numLikes } = postData;