Open zipang opened 6 years ago
I would like to keep tiny glob as simple as possible. What would a implementation for this look like and what are the benefits? It's easy to map the returned array to get basename, extension etc.
Hi @terkelg ! I do agree that mapping on the returned array is pretty easy in term of coding, but i did believe that your package's implementation was all about performances !?
To load a vfile
, i need the full path of a file.
So right now, the implementation is allready doing a full re-map on the matched elements just to return their absolute path.
So mapping again on all the matched elements returned by glob
to convert them to vfile
.. and it would be 2 unnecessary loops involved.
I can submit a PR if you are interested..
I would love to see some code, but I can't promise I'll merge it into master. All PRs are very welcome. Can you do it without introducing dependencies?
It would be awesome to allow an optional constructor in the options, to return whatever types the user really needs, ie : an array of vfile instead of an array of paths.
Example :