| Conditions | 2 |
| Paths | 2 |
| Total Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | import { findTreeNode } from './findTreeNode'; |
||
| 3 | export const setTreeValue = ( |
||
| 4 | treeData, |
||
| 5 | path, |
||
| 6 | values, |
||
| 7 | childIdentifier = 'children', |
||
| 8 | rootIdentifier = 'root' |
||
| 9 | ) => { |
||
| 10 | |||
| 11 | const node = findTreeNode(treeData, path, childIdentifier, rootIdentifier); |
||
| 12 | |||
| 13 | if (node) { |
||
| 14 | Object.assign(node, values); |
||
| 15 | } |
||
| 16 | |||
| 17 | return treeData; |
||
| 18 | }; |
||
| 19 |