MCPcopy Create free account
hub / github.com/donghaxkim/react-rewrite / appendToChildText

Function appendToChildText

packages/cli/src/transform.ts:846–856  ·  view source on GitHub ↗
(child: any, text: string)

Source from the content-addressed store, hash-verified

844}
845
846function appendToChildText(child: any, text: string): boolean {
847 if (child.type === "JSXText") {
848 child.value += text;
849 return true;
850 }
851 if (child.type === "JSXExpressionContainer" && child.expression?.type === "StringLiteral") {
852 child.expression.value = String(child.expression.value ?? "") + text;
853 return true;
854 }
855 return false;
856}
857
858function stripLeadingWhitespace(child: any): void {
859 if (child.type === "JSXText") {

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected