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

Function prependToChildText

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

Source from the content-addressed store, hash-verified

832}
833
834function prependToChildText(child: any, text: string): boolean {
835 if (child.type === "JSXText") {
836 child.value = text + child.value;
837 return true;
838 }
839 if (child.type === "JSXExpressionContainer" && child.expression?.type === "StringLiteral") {
840 child.expression.value = text + String(child.expression.value ?? "");
841 return true;
842 }
843 return false;
844}
845
846function appendToChildText(child: any, text: string): boolean {
847 if (child.type === "JSXText") {

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected