Comparing version 1.2.21 to 1.2.22
import { Prompt } from 'enquirer'; | ||
import { PromptOptionsType, PromptTypes } from './prompt.interface'; | ||
export declare function newPrompt<T extends PromptTypes>(type: T, options: PromptOptionsType<T>): Prompt; | ||
export declare function createPrompt<T extends PromptTypes>(type: T, options: PromptOptionsType<T>): Promise<any>; | ||
export declare function createPrompt<T extends PromptTypes>(type: T, options: PromptOptionsType<T>, error?: boolean): Promise<any>; |
@@ -71,4 +71,7 @@ "use strict"; | ||
exports.newPrompt = newPrompt; | ||
function createPrompt(type, options) { | ||
function createPrompt(type, options, error = false) { | ||
return newPrompt(type, options).on('cancel', () => { | ||
if (error) { | ||
throw new Error('Cancelled prompt.'); | ||
} | ||
return 'Cancelled prompt.'; | ||
@@ -75,0 +78,0 @@ }).run(); |
{ | ||
"name": "listr2", | ||
"version": "1.2.21", | ||
"version": "1.2.22", | ||
"description": "Terminal task list reborn!", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
77445
1138