( element: any, config: Config, indentation: string, depth: number, refs: Refs, printer: Printer, )
| 105 | } |
| 106 | |
| 107 | export const serialize: NewPlugin['serialize'] = ( |
| 108 | element: any, |
| 109 | config: Config, |
| 110 | indentation: string, |
| 111 | depth: number, |
| 112 | refs: Refs, |
| 113 | printer: Printer, |
| 114 | ) => |
| 115 | ++depth > config.maxDepth |
| 116 | ? printElementAsLeaf(getType(element), config) |
| 117 | : printElement( |
| 118 | getType(element), |
| 119 | printProps( |
| 120 | getPropKeys(element), |
| 121 | element.props, |
| 122 | config, |
| 123 | indentation + config.indent, |
| 124 | depth, |
| 125 | refs, |
| 126 | printer, |
| 127 | ), |
| 128 | printChildren( |
| 129 | getChildren(element.props.children), |
| 130 | config, |
| 131 | indentation + config.indent, |
| 132 | depth, |
| 133 | refs, |
| 134 | printer, |
| 135 | ), |
| 136 | config, |
| 137 | indentation, |
| 138 | ) |
| 139 | |
| 140 | export const test: NewPlugin['test'] = (val: unknown) => |
| 141 | val != null && ReactIs.isElement(val) |
nothing calls this directly
no test coverage detected