37.fetchGitHubName

Write a function named fetchGitHubName that receives 1 parameter

  • a string representing a GitHub username

The function should return a Promise that resolves to the full name of the GitHub user with this username. If the user does not exist, the Promise should resolve to null.

PS: here's the link to the GitHub API: https://docs.github.com/en/rest/users. It's your job to find the correct endpoint to call.

Example 1

Input

username

=

Output

a Promise that resolves with the value below: