Total Complexity | 2 |
Complexity/F | 2 |
Lines of Code | 11 |
Function Count | 1 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | /** |
||
9 | function addOptionToState(option, state, creator = '') { |
||
10 | const choiceLength = state.choices.length; |
||
11 | state.choices.push(option); |
||
12 | if (state.choiceCreator === undefined) { |
||
13 | state.choiceCreator = {[choiceLength]: creator}; |
||
14 | } else { |
||
15 | state.choiceCreator[choiceLength] = creator; |
||
16 | } |
||
17 | } |
||
18 | |||
19 | exports.addOptionToState = addOptionToState; |
||
20 |