node-tree-flatten
node-tree-flatten copied to clipboard
Implement key as an optional callback to retrieve the key
Right now the only way to retrieve the current tree node children is through the key argument. This argument should accept a callback that will be called with the current node-element to retrieve the children list.
flatten(tree, (node) => node.children.filter() ... ;