anc95 / inquirer-file-tree-selection

inquirer prompt for select a file or dir by file tree
49 stars 26 forks source link

enhancement to allow only displaying valid choices #9

Closed hogpilot closed 4 years ago

hogpilot commented 4 years ago

When a validate function is provided, it would be useful to only display valid choices in the file tree. For instance, if you only want to have the user select files of a specific file extension, then removing all invalid files from the tree (and any folders that don't contain valid files) could make for a significantly better user experience when the file tree structure is large and/or deeply nested.

I'll submit a pull request which addresses this issue.