| 65 | }); |
| 66 | const replaceStateWithThis = (str: string) => str.replaceAll('state.', 'this.'); |
| 67 | const getStateObjectString = (json: MitosisComponent) => |
| 68 | flow( |
| 69 | getStateObjectStringFromComponent, |
| 70 | trim, |
| 71 | replaceInputRefs(json), |
| 72 | renderMountHook(json), |
| 73 | renderUpdateHooks(json), |
| 74 | replaceStateWithThis, |
| 75 | // cleanup bad regexes that result in malformed JSON strings that start with `{,` |
| 76 | (x) => (x.startsWith('{,') ? x.replace('{,', '{') : x), |
| 77 | )(json); |
| 78 | |
| 79 | const bindEventHandlerKey = compose(dashCase, removeOnFromEventName); |
| 80 | const bindEventHandlerValue = compose( |