(elementType: string, props: any)
| 3 | import { getContext } from "./context"; |
| 4 | |
| 5 | export default function createElement(elementType: string, props: any) { |
| 6 | const { parserOptions } = getContext(); |
| 7 | const Element: IElement = elements[elementType]; |
| 8 | if (!Element) throw new Error(`unknown element of type '${elementType}'`); |
| 9 | return new Element(props, parserOptions); |
| 10 | } |
no test coverage detected