(element: ReactElement<unknown>)
| 32 | } from "./types"; |
| 33 | |
| 34 | export function encode(element: ReactElement<unknown>) { |
| 35 | const json = encodeChildren([element]); |
| 36 | const stringified = JSON.stringify(json); |
| 37 | |
| 38 | return encodeURIComponent(stringified); |
| 39 | } |
| 40 | |
| 41 | function encodeChildren(children: ReactElement<unknown>[]): EncodedElement[] { |
| 42 | const elements: EncodedElement[] = []; |
no test coverage detected
searching dependent graphs…