Skip to content

Conversation

jvasseur
Copy link

Purpose of this pull request?

  • Documentation update
  • Bug fix
  • Enhancement
  • Other, please explain:

What changes did you make?

When using a question name containing a dot (like foo.bar) the answers are returned as keys in an object ({ foo: { bar: 'answer' } }), this means answers[name] will be undefined and null will be stored in storage instead of the correct answer.

This PR fix it by using lodash's get to get the correct value from the answers.


for (const [name, questionStorage] of Object.entries(storageForQuestion)) {
const answer: any = answers[name] === undefined ? null : answers[name];
const answer: any = _.get(answers, name, null);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is inquirer lodash aware too?
If not it may cause issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants