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

Method wrapWithStyleColors

src/cell.js:215–229  ·  view source on GitHub ↗
(styleProperty, content)

Source from the content-addressed store, hash-verified

213 }
214
215 wrapWithStyleColors(styleProperty, content) {
216 if (this[styleProperty] && this[styleProperty].length) {
217 try {
218 let colors = require('@colors/colors/safe');
219 for (let i = this[styleProperty].length - 1; i >= 0; i--) {
220 colors = colors[this[styleProperty][i]];
221 }
222 return colors(content);
223 } catch (e) {
224 return content;
225 }
226 } else {
227 return content;
228 }
229 }
230
231 /**
232 * Renders a line of text.

Callers 3

drawTopMethod · 0.95
stylizeLineMethod · 0.95
drawBottomMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected