Inquirer.js icon indicating copy to clipboard operation
Inquirer.js copied to clipboard

Passing answers with nested properties to prompt() doesn't seem to work

Open atava opened this issue 4 years ago • 3 comments

As per the doc about prompt(), passing an "answers" hash should have it skip those questions for which values are set in the hash.

It doesn't seem to work with nested properties (e.g. "foo.bar"). I tested changing the property to "fooBar" and it works, so I presume it's the nesting/path that is not dealt with properly.

atava avatar Jul 01 '21 19:07 atava

Can you provide a code example?

SBoudrias avatar Jul 02 '21 16:07 SBoudrias

I think this could be one: InquirerPromptAnswersTest

When using a property path for the question instead of a simple property (e.g. 'info.sex' instead of 'sex') the default behavior of skipping the question fails.

atava avatar Jul 03 '21 05:07 atava

pull request #1028

owings1 avatar Jul 21 '21 01:07 owings1