From 061ea2915c4c7e98974391b4db4ce752fdc11fc1 Mon Sep 17 00:00:00 2001 From: Ojas Inamdar Date: Sun, 3 Jul 2022 01:08:52 +0530 Subject: [PATCH] fix: stdio in password is now optional and minor fixes --- packages/input/src/index.ts | 4 ++-- packages/password/src/index.ts | 2 +- packages/rawlist/src/index.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/input/src/index.ts b/packages/input/src/index.ts index 7b951931f..8097c2dcc 100644 --- a/packages/input/src/index.ts +++ b/packages/input/src/index.ts @@ -6,13 +6,13 @@ import { isEnterKey, isBackspaceKey, AsyncPromptConfig, -} from '@inquirer/core/src'; +} from '@inquirer/core'; import chalk from 'chalk'; export type InputConfig = AsyncPromptConfig & { default?: string; transformer?: (value: string, { isFinal }: { isFinal: boolean }) => string; - filter: (input: string) => string + filter?: (input: string) => string }; export default createPrompt((config, done) => { diff --git a/packages/password/src/index.ts b/packages/password/src/index.ts index 78b1006ec..4188a9708 100644 --- a/packages/password/src/index.ts +++ b/packages/password/src/index.ts @@ -5,7 +5,7 @@ type PasswordConfig = InputConfig & { mask?: boolean | string; }; -export default (config: PasswordConfig, stdio: Parameters[1]) => { +export default (config: PasswordConfig, stdio?: Parameters[1]) => { if (config.transformer) { throw new Error( 'Inquirer password prompt do not support custom transformer function. Use the input prompt instead.' diff --git a/packages/rawlist/src/index.ts b/packages/rawlist/src/index.ts index f786de3a9..1d741381b 100644 --- a/packages/rawlist/src/index.ts +++ b/packages/rawlist/src/index.ts @@ -5,7 +5,7 @@ import { usePrefix, isEnterKey, AsyncPromptConfig, -} from '@inquirer/core/src'; +} from '@inquirer/core'; import chalk from 'chalk'; const numberRegex = /[0-9]+/;