I installed Inquirer
package for a command prompt tool and wrote this simple prompt:
function promptUser(): void {
console.clear();
displayTodoList(); // harmless method.
inquirer.prompt({
type: "list",
name: "command",
message: "Choose option",
choices: Object.values(Commands)
}).then(answers => {
if (answers["command"] !== Commands.Quit) {
promptUser(); // some other harmless method.
}
})
}
But Typescript gives me compile error that values
does not exist on type 'ObjectConstructor
' which is this line:
choices: Object.values(Commands)