| 26 | const fallback = (params && params.fallback) || Fallback |
| 27 | |
| 28 | const createChild = c => { |
| 29 | if (c == null) { |
| 30 | return null |
| 31 | } |
| 32 | if (Array.isArray(c)) { |
| 33 | return c.map(createChild) |
| 34 | } |
| 35 | if ( |
| 36 | typeof c === 'boolean' || |
| 37 | typeof c === 'number' || |
| 38 | typeof c === 'string' |
| 39 | ) { |
| 40 | return c |
| 41 | } |
| 42 | if (c.type) { |
| 43 | return createFromObject(c) |
| 44 | } |
| 45 | return null |
| 46 | } |
| 47 | |
| 48 | const createFromObject = (converted: ConvertedElement) => { |
| 49 | const component = components[converted.type] || fallback |
no test coverage detected