MCPcopy Create free account
hub / github.com/apache/fesod / processBlogAuthors

Function processBlogAuthors

website/github-avatar.js:127–143  ·  view source on GitHub ↗

* Processes blog authors data and adds avatar_base64 property * @param {Object} teamData - Team data * @param {Array} avatars - Array of avatars * @returns {Promise } Blog authors data

(teamData, avatars)

Source from the content-addressed store, hash-verified

125 * @returns {Promise<Object>} Blog authors data
126 */
127async function processBlogAuthors(teamData, avatars) {
128 const blogAuthorsMapPath = {};
129 (teamData.pmc.concat(teamData.committer) || []).forEach((m) => {
130 const gitName = getGitName(m.gitUrl);
131 const avatarObj = avatars.find((item) => item.id === m.githubId);
132 blogAuthorsMapPath[gitName] = {
133 "name": m.name,
134 "url": m.gitUrl,
135 "image_url": "data:image/png;base64," + avatarObj.avatar_base64,
136 "socials": {
137 "github": gitName
138 }
139 }
140 });
141
142 return blogAuthorsMapPath;
143}
144
145/**
146 * Main function

Callers 1

mainFunction · 0.85

Calls 1

getGitNameFunction · 0.70

Tested by

no test coverage detected