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

Function hasVisibleTextChild

packages/cli/src/transform.ts:923–929  ·  view source on GitHub ↗
(children: any[], startIndex: number, source?: string, lineStarts?: number[])

Source from the content-addressed store, hash-verified

921}
922
923function hasVisibleTextChild(children: any[], startIndex: number, source?: string, lineStarts?: number[]): boolean {
924 for (let i = startIndex; i < children.length; i++) {
925 const childText = getRenderedChildText(children[i], source, lineStarts);
926 if (/\S/.test(childText)) return true;
927 }
928 return false;
929}
930
931function hasVisibleTextInEntries(entries: any[], source?: string, lineStarts?: number[]): boolean {
932 return entries.some((entry) => /\S/.test(getRenderedChildText(entry, source, lineStarts)));

Callers 1

Calls 1

getRenderedChildTextFunction · 0.85

Tested by

no test coverage detected