(username: string)
| 48 | |
| 49 | export 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 | }; |
nothing calls this directly
no test coverage detected