(parentPath, _data)
| 148 | }; |
| 149 | // Create Node |
| 150 | const create = async (parentPath, _data) => { |
| 151 | try { |
| 152 | const _node_path = parentPath + '/' + _data.id; |
| 153 | return mtree.addNode(parentPath, _node_path, _data); |
| 154 | } catch { |
| 155 | return null; // or throw error as you see fit |
| 156 | } |
| 157 | }; |
| 158 | |
| 159 | // Remove Node |
| 160 | const remove = async (path, _removeOnlyChild) => { |