Closed ycmjason closed 6 years ago
Even passing undefined
is better so that I could use default parameters for searchString. Now I have to do the old school searchString = searchString || ''
in order to set it to ''
.
Null was chosen over ''
so that you could determine if the user has typed something, then removed it (resulting in '' ) or if it was the first "search".
I agree that undefined
is better.
Open a PR if you like, will close #52 as well
Is it possible to pass in an array/list as default instead of initial null/undefined. Maybe it could be picked up from default
or choices
key from inquirer.
The idea of using undefined is that we could use function default args to set whatever default you want.
Thank you very much for building this amazing tool!
I find it weird that the initial search string being passed to
source
is set tonull
. I think it would make more sense if''
is passed. Is there any philosophy behind this decision?Would be happy to submit a pull request to change this.