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

Function setTextLikeValue

packages/cli/src/transform.ts:908–916  ·  view source on GitHub ↗
(child: any, value: string)

Source from the content-addressed store, hash-verified

906}
907
908function setTextLikeValue(child: any, value: string): void {
909 if (child.type === "JSXText") {
910 child.value = value;
911 return;
912 }
913 if (child.type === "JSXExpressionContainer" && child.expression?.type === "StringLiteral") {
914 child.expression.value = value;
915 }
916}
917
918function isWhitespaceOnlyTextLikeChild(child: any): boolean {
919 const value = getTextLikeValue(child);

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected