Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async function getProject(token: string): Promise {
if (cliOptions.project) {
return cliOptions.project;
}
const projects = await firebaseTools.list({ token });
const { project } = await inquirer.prompt([
{
type: 'list',
name: 'project',
message: 'Which project would you like to use to test?',
choices: projects.map((project: { [k: string]: string }) => ({
name: chalk`${project.name} {grey (${project.id})}`,
value: project
}))
}
]);
return project.id;
}