( component: DevComponent, optionsOrLang: SupportedLang | StringifyOptions )
| 169 | } |
| 170 | |
| 171 | export function stringifyComponent( |
| 172 | component: DevComponent, |
| 173 | optionsOrLang: SupportedLang | StringifyOptions |
| 174 | ): string { |
| 175 | const options: StringifyOptions = |
| 176 | typeof optionsOrLang === 'string' ? { lang: optionsOrLang } : optionsOrLang |
| 177 | |
| 178 | switch (options.lang) { |
| 179 | case 'vue': { |
| 180 | return stringifyVueComponent(component, 0, options.isInline) |
| 181 | } |
| 182 | case 'jsx': |
| 183 | case 'tsx': |
| 184 | default: { |
| 185 | return stringifyJSXComponent(component, 0, options.isInline) |
| 186 | } |
| 187 | } |
| 188 | } |
| 189 | |
| 190 | const INDENT_UNIT = ' ' |
| 191 |
no test coverage detected