(state, controlChars)
| 59 | addToCodeCache('strikethrough', 9, 29); |
| 60 | |
| 61 | function updateState(state, controlChars) { |
| 62 | let controlCode = controlChars[1] ? parseInt(controlChars[1].split(';')[0]) : 0; |
| 63 | if ((controlCode >= 30 && controlCode <= 39) || (controlCode >= 90 && controlCode <= 97)) { |
| 64 | state.lastForegroundAdded = controlChars[0]; |
| 65 | return; |
| 66 | } |
| 67 | if ((controlCode >= 40 && controlCode <= 49) || (controlCode >= 100 && controlCode <= 107)) { |
| 68 | state.lastBackgroundAdded = controlChars[0]; |
| 69 | return; |
| 70 | } |
| 71 | if (controlCode === 0) { |
| 72 | for (let i in state) { |
| 73 | /* istanbul ignore else */ |
| 74 | if (Object.prototype.hasOwnProperty.call(state, i)) { |
| 75 | delete state[i]; |
| 76 | } |
| 77 | } |
| 78 | return; |
| 79 | } |
| 80 | let info = codeCache[controlChars[0]]; |
| 81 | if (info) { |
| 82 | state[info.set] = info.to; |
| 83 | } |
| 84 | } |
| 85 | |
| 86 | function readState(line) { |
| 87 | let code = codeRegex(true); |
no outgoing calls
no test coverage detected
searching dependent graphs…