node-directory-tree icon indicating copy to clipboard operation
node-directory-tree copied to clipboard

Added depth option

Open dvergeylen opened this issue 6 years ago • 1 comments

Minimal code change, optional depth option, new test and updated README.md 🙂

Fix #34

dvergeylen avatar Aug 26 '19 11:08 dvergeylen

Hi, thanks for the PR!

I suggest you extract the code in a new directoryTreeWithDepth function that takes an extra depth parameter which is still Number? and decrement that as a primitive value. This I think makes things easier to follow (the depth recursion pattern is pretty familiar to people I think) and you also get around the issue of copying the settings object every time.

mihneadb avatar Aug 29 '19 05:08 mihneadb