(parent: IMultiChoice, child: IChoice)
| 1006 | } |
| 1007 | |
| 1008 | function insertIntoMulti(parent: IMultiChoice, child: IChoice): void { |
| 1009 | if (!Array.isArray(parent.choices)) { |
| 1010 | parent.choices = []; |
| 1011 | } |
| 1012 | const idx = parent.choices.findIndex((choice) => choice.id === child.id); |
| 1013 | if (idx !== -1) { |
| 1014 | parent.choices.splice(idx, 1, child); |
| 1015 | } else { |
| 1016 | parent.choices.push(child); |
| 1017 | } |
| 1018 | } |
| 1019 | |
| 1020 | function findMultiByPath( |
| 1021 | rootChoices: IChoice[], |
no test coverage detected