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

Function getTextLikeValue

packages/cli/src/transform.ts:900–906  ·  view source on GitHub ↗
(child: any)

Source from the content-addressed store, hash-verified

898}
899
900function getTextLikeValue(child: any): string | null {
901 if (child.type === "JSXText") return child.value;
902 if (child.type === "JSXExpressionContainer" && child.expression?.type === "StringLiteral") {
903 return String(child.expression.value ?? "");
904 }
905 return null;
906}
907
908function setTextLikeValue(child: any, value: string): void {
909 if (child.type === "JSXText") {

Calls

no outgoing calls

Tested by

no test coverage detected