(state, ret)
| 95 | } |
| 96 | |
| 97 | function unwindState(state, ret) { |
| 98 | let lastBackgroundAdded = state.lastBackgroundAdded; |
| 99 | let lastForegroundAdded = state.lastForegroundAdded; |
| 100 | |
| 101 | delete state.lastBackgroundAdded; |
| 102 | delete state.lastForegroundAdded; |
| 103 | |
| 104 | Object.keys(state).forEach(function (key) { |
| 105 | if (state[key]) { |
| 106 | ret += codeCache[key].off; |
| 107 | } |
| 108 | }); |
| 109 | |
| 110 | if (lastBackgroundAdded && lastBackgroundAdded != '\u001b[49m') { |
| 111 | ret += '\u001b[49m'; |
| 112 | } |
| 113 | if (lastForegroundAdded && lastForegroundAdded != '\u001b[39m') { |
| 114 | ret += '\u001b[39m'; |
| 115 | } |
| 116 | |
| 117 | return ret; |
| 118 | } |
| 119 | |
| 120 | function rewindState(state, ret) { |
| 121 | let lastBackgroundAdded = state.lastBackgroundAdded; |
no outgoing calls
no test coverage detected
searching dependent graphs…