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

Function isEmptyTextLikeChild

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

Source from the content-addressed store, hash-verified

890}
891
892function isEmptyTextLikeChild(child: any): boolean {
893 if (child.type === "JSXText") return child.value === "";
894 if (child.type === "JSXExpressionContainer" && child.expression?.type === "StringLiteral") {
895 return String(child.expression.value ?? "") === "";
896 }
897 return false;
898}
899
900function getTextLikeValue(child: any): string | null {
901 if (child.type === "JSXText") return child.value;

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected