Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export async function confirmPrompt(message: string, autoValue?: boolean): Promise {
const confirmPrompt = new ConfirmPrompt({
type: 'confirm',
name: 'value',
initial: autoValue !== undefined ? autoValue : false,
message: message,
});
const confirmPromise = toPromise(confirmPrompt);
if (autoValue !== undefined) confirmPrompt.submit();
const choice = await confirmPromise;
return choice[0] as boolean;
}