Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Async function in validator #403

Open
JCDenton47 opened this issue Jul 21, 2022 · 0 comments
Open

Async function in validator #403

JCDenton47 opened this issue Jul 21, 2022 · 0 comments

Comments

@JCDenton47
Copy link

I try to put async function in the validator of the question object. It always prompt twice. Is it possible to put async function in validator ?
validate: async (ans: string[]) => { // console.log(ans); // if (ans.length === 0 || ans.length > 3) { // return 'Error!!! Invalid PoC number'; // } else if (ans.length !== new Set(ans).size) { // return 'Duplicate value inserted'; // } const PoCValid = await validatePoCs(ans.map((val) => (val += '@ea.com'))); return PoCValid; // return true; },
image
** I only enter once, but the question always prompt twice **

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant