inquirer-search-list
inquirer-search-list copied to clipboard
inquirer.Separator is not supported
It doesn't look good, and when typing any character, it crashes

choices: [
"Pepperoni",
"Ham",
"Ground Meat",
"Bacon",
new inquirer.Separator(),
"Mozzarella",
"Bottle"
],
That's how I'm handling it for now.
inquirer
.prompt([
{
type: 'search-list',
message: 'xxxx',
name: 'xxxx',
choices: docList.map((item) => {
// 👇👇👇👇👇
if (item.line || item.type) {
item.name = item.line
item.value = false
delete item.line
delete item.type
}
return item
}),
validate: (answer) => !!answer,
},
])