-
-
Notifications
You must be signed in to change notification settings - Fork 315
Closed
Description
Describe the bug
You can't get a true/false out of the select choices. I realise you could use the confirm prompt in many cases, but in my case I want a yes/no/quit dialog. However false or 0 returns 1 as the selection.
To Reproduce
const prompts = require("prompts");
const test = async () => {
const data = await prompts({
type: "select",
name: "test",
message: `do you like ice cream`,
choices: [
{
title: "Yes",
value: true
},
{ title: "No", value: false },
{ title: "Third random option", value: 'other' },
]
});
console.log(data);
};
test();
Results
selene:social-graph-2 tomchambers$ node tools/test.js
✔ do you like ice cream › No
{ test: 1 }
selene:social-graph-2 tomchambers$ node tools/test.js
✔ do you like ice cream › Yes
{ test: true }
selene:social-graph-2 tomchambers$
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels