(element: ReactNode)
| 419 | } |
| 420 | |
| 421 | function countChars(element: ReactNode) { |
| 422 | if (typeof element === 'string') { |
| 423 | return element.length; |
| 424 | } else if (Array.isArray(element)) { |
| 425 | return element.reduce((p, i) => p + countChars(i), 0); |
| 426 | } else if (element && typeof element === 'object' && 'props' in element && element.props) { |
| 427 | return countChars((element.props as any).children); |
| 428 | } |
| 429 | return 0; |
| 430 | } |
| 431 | |
| 432 | function renderProp(name: string, value: any, control?: PropControl, indent = '') { |
| 433 | if (value === control?.default) { |
no outgoing calls
no test coverage detected