Closed kubukoz closed 10 months ago
ok, I got it - lzstring.compressToEncodedURIComponent
from https://pieroxy.net/blog/pages/lz-string/index.html . There are typings so we could use ScalablyTyped for the bindings, but given it's just ~2 methods we could write the JS stubs manually too.
That's a must have, I thought about it a while back but forgot to record an issue for it, thanks for that
I'll give it a go.
Some playgrounds with code snippets support this, e.g.
https://www.typescriptlang.org/play?#code/C4TwDgpgBAqgzhATlAvFA3gKCjqA7AQwFsIAuKOYRASzwHNtcC6z8BXIgIyUZ2oBNylGvUwBfTEA
I'm not sure what encoding it is, but the original was
.
We could start by base64-encoding the input, or find a more optimal encoding for code such as the one used by typescript playground.
The "identifier" of the snippet would automatically update the URI in the browser for easy copy-pasting.