MCPcopy Index your code
hub / github.com/nodejs/nodejs.org / mapNameToAuthor

Function mapNameToAuthor

apps/site/util/author.ts:50–69  ·  view source on GitHub ↗
(username: string)

Source from the content-addressed store, hash-verified

48
49export const getAuthorWithName = (names: Array<string>, hasUrl: boolean) => {
50 const mapNameToAuthor = (username: string) => {
51 if (Object.keys(authors).includes(username)) {
52 if (username in authors) {
53 const { id, name, website } = authors[username];
54
55 return {
56 image: getGitHubAvatarUrl(id),
57 name,
58 nickname: id,
59 fallback: getAcronymFromString(name),
60 url: hasUrl ? website : undefined,
61 };
62 }
63 }
64
65 return {
66 nickname: username,
67 fallback: getAcronymFromString(username),
68 };
69 };
70
71 return names.map(mapNameToAuthor);
72};

Callers

nothing calls this directly

Calls 2

getGitHubAvatarUrlFunction · 0.90
getAcronymFromStringFunction · 0.90

Tested by

no test coverage detected