mokkabonna / inquirer-autocomplete-prompt

Autocomplete prompt for inquirer
ISC License
350 stars 82 forks source link

Can the default input value be undefined instead of null? #52

Closed pruett closed 6 years ago

pruett commented 6 years ago

Thanks for a great plugin! Really enjoy it.

I got tripped up with the default value of the input parameter of the source function.

const exampleSearch = async (answers, input = "") => {
  // since `null` is passed to input, default parameters won't work here
}

I see in your example you are doing something like input = input || "" but I was curious if the value can be undefined and work just as well. This would allow for default parameters to work instead of overloading the parameter on the first line of the function.

mokkabonna commented 6 years ago

Tracking this in #54

pruett commented 6 years ago

👍