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.
Thanks for a great plugin! Really enjoy it.
I got tripped up with the default value of the
input
parameter of the source function.I see in your example you are doing something like
input = input || ""
but I was curious if the value can beundefined
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.