From 896698a9d11958806fd826ef6c1c04c090110eb4 Mon Sep 17 00:00:00 2001 From: TienLeok Ngo Date: Tue, 22 Oct 2019 17:44:31 +0800 Subject: [PATCH 1/2] Fix for #212 --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 4e9df15..3a3fe4f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -334,7 +334,7 @@ async function GetUtilParametersByInquirer() { const { timeout } = (await inquirer.prompt({ message: "Query timeout(ms):", name: "timeout", - type: "input", + type: "number", validate(value) { const valid = !Number.isNaN(parseInt(value, 10)); return valid || "Please enter a valid number"; From 16596a0eb23f14002ebb69b82a9604ae4f729811 Mon Sep 17 00:00:00 2001 From: Kononnable Date: Sun, 3 Nov 2019 17:18:43 +0100 Subject: [PATCH 2/2] parse timeout parameter passed by inqiorer --- src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index 3a3fe4f..099c33d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -334,13 +334,13 @@ async function GetUtilParametersByInquirer() { const { timeout } = (await inquirer.prompt({ message: "Query timeout(ms):", name: "timeout", - type: "number", + type: "input", validate(value) { const valid = !Number.isNaN(parseInt(value, 10)); return valid || "Please enter a valid number"; } })) as any; - connectionOptions.timeout = timeout; + connectionOptions.timeout = parseInt(timeout, 10); } } const { customizeGeneration } = (await inquirer.prompt([