(mode, state)
| 67 | } |
| 68 | |
| 69 | export function copyState(mode, state) { |
| 70 | if (state === true) return state |
| 71 | if (mode.copyState) return mode.copyState(state) |
| 72 | let nstate = {} |
| 73 | for (let n in state) { |
| 74 | let val = state[n] |
| 75 | if (val instanceof Array) val = val.concat([]) |
| 76 | nstate[n] = val |
| 77 | } |
| 78 | return nstate |
| 79 | } |
| 80 | |
| 81 | // Given a mode and a state (for that mode), find the inner mode and |
| 82 | // state at the position that the state refers to. |
no outgoing calls
no test coverage detected