Rewriting to Typescript could help with understandability and bugs like this, with negligible reduction in performance <img width="698" height="194" alt="Image" src="https://github.com/user-attachments/assets/77c3cb17-71ba-401e-ba14-3d60d87d96ee" /> - [x] I'm willing to implement this feature myself