From 316da0e7c7fd73874901e79b3ba66a4d72b97dc1 Mon Sep 17 00:00:00 2001 From: Rafa Mel Date: Fri, 26 Apr 2019 05:08:52 +0200 Subject: [PATCH] feat(exposed/prompts): confirm shows timeout if passed --- src/exposed/prompts/confirm.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/exposed/prompts/confirm.ts b/src/exposed/prompts/confirm.ts index 9bf06e2..3d56aea 100644 --- a/src/exposed/prompts/confirm.ts +++ b/src/exposed/prompts/confirm.ts @@ -17,7 +17,11 @@ export default function confirm(options: IConfirmOptions = {}) { prompts({ type: 'confirm', name: 'value', - message: options.message || 'Continue?', + message: + (options.message || 'Continue?') + + (options.timeout + ? ` [${Math.round(options.timeout / 100) / 10}s]` + : ''), initial: options.initial || false }) );