MCPcopy Create free account
hub / github.com/cli-table/cli-table3 / unwindState

Function unwindState

src/utils.js:97–118  ·  view source on GitHub ↗
(state, ret)

Source from the content-addressed store, hash-verified

95}
96
97function 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
120function rewindState(state, ret) {
121 let lastBackgroundAdded = state.lastBackgroundAdded;

Callers 2

truncateWidthWithAnsiFunction · 0.85
colorizeLinesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…