MCPcopy Create free account
hub / github.com/Noumena-Network/code / StyledText

Function StyledText

src/ink/Ansi.tsx:272–330  ·  view source on GitHub ↗
(t0)

Source from the content-addressed store, hash-verified

270
271// Wrapper component that handles bold/dim mutual exclusivity for Text
272function StyledText(t0) {
273 const $ = _c(14);
274 let bold;
275 let children;
276 let dim;
277 let rest;
278 if ($[0] !== t0) {
279 ({
280 bold,
281 dim,
282 children,
283 ...rest
284 } = t0);
285 $[0] = t0;
286 $[1] = bold;
287 $[2] = children;
288 $[3] = dim;
289 $[4] = rest;
290 } else {
291 bold = $[1];
292 children = $[2];
293 dim = $[3];
294 rest = $[4];
295 }
296 if (dim) {
297 let t1;
298 if ($[5] !== children || $[6] !== rest) {
299 t1 = <Text {...rest} dim={true}>{children}</Text>;
300 $[5] = children;
301 $[6] = rest;
302 $[7] = t1;
303 } else {
304 t1 = $[7];
305 }
306 return t1;
307 }
308 if (bold) {
309 let t1;
310 if ($[8] !== children || $[9] !== rest) {
311 t1 = <Text {...rest} bold={true}>{children}</Text>;
312 $[8] = children;
313 $[9] = rest;
314 $[10] = t1;
315 } else {
316 t1 = $[10];
317 }
318 return t1;
319 }
320 let t1;
321 if ($[11] !== children || $[12] !== rest) {
322 t1 = <Text {...rest}>{children}</Text>;
323 $[11] = children;
324 $[12] = rest;
325 $[13] = t1;
326 } else {
327 t1 = $[13];
328 }
329 return t1;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected