co-prompt
co-prompt copied to clipboard
Restricting possible user inputs
This isn't really an issue, just a question?
This is how i currently restrict the possible inputs
let a = (yield prompt("Create app? (Y/n) ")) || "Y";
while (!(/^([yn]|(yes)|(no))$/ig.test(a))) a= yield prompt("Create app? (Y/n) ");
Is there a better way of doing it?