MCPcopy Create free account
hub / github.com/continuedev/continue / childToText

Function childToText

gui/src/components/StyledMarkdownPreview/utils.ts:38–48  ·  view source on GitHub ↗
(child: any)

Source from the content-addressed store, hash-verified

36}
37
38function childToText(child: any): string {
39 if (typeof child === "string") {
40 return child;
41 } else if (child?.props) {
42 return childToText(child.props?.children);
43 } else if (Array.isArray(child)) {
44 return childrenToText(child);
45 } else {
46 return "";
47 }
48}
49
50export function childrenToText(children: any) {
51 return children.map((child: any) => childToText(child)).join("");

Callers 1

childrenToTextFunction · 0.85

Calls 1

childrenToTextFunction · 0.85

Tested by

no test coverage detected