60.fetchNamesOfAllPublicRepos

Write a function named fetchNamesOfAllPublicRepos that receives one parameter

  • a string representing a GitHub username

The function should return a Promise that resolves with an array of strings representing the names of all the public repositories for the user with that username.

If the user does not exist, the returned Promise should resolve to an empty Array.

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

Example 1

Input

username

=

Output

a Promise that resolves with the value below:

Explanation

Keep in mind this is a live API so the output may change may be different.