(element: ReactElement<unknown>)
| 13 | } from "./types"; |
| 14 | |
| 15 | export function encode(element: ReactElement<unknown>) { |
| 16 | const json = encodeChildren([element]); |
| 17 | const stringified = JSON.stringify(json); |
| 18 | |
| 19 | return encodeURIComponent(stringified); |
| 20 | } |
| 21 | |
| 22 | function encodeChildren(children: ReactElement<unknown>[]): EncodedElement[] { |
| 23 | const elements: EncodedElement[] = []; |
nothing calls this directly
no test coverage detected