Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const project = await (async () => {
if (projectId) return projectId;
const projects = await firebaseTools.projects.list({ token });
const response = await inquirer.prompt([
{
type: 'list',
name: 'projectId',
message: 'Which project would you like to use to test?',
choices: projects
.sort(project =>
project.name.toLowerCase().includes('jscore') ? -1 : 1
)
.map(project => ({
name: `${project.displayName} (${project.projectId})`,
value: project
}))
}
]);