https://github.com/h4l/json.bash/blob/main/json.bash
You've boiled it down to a set of very elegant constructs. Respect. Thank you @h4l, this is badass.
I hope you follow up with a golang or rust implementation, that would really be something else.
p.s. I noticed the following odd behaviors with escaping delimiters (e.g. "="), is there a way to get an un-escaped equal sign as the trailing part of a key or leading part of a value?
$ docker container run --rm ghcr.io/h4l/json.bash/jb msg=Hi
{"msg":"Hi"}
$ docker container run --rm ghcr.io/h4l/json.bash/jb msg=\=Hi
{"msg=Hi":"msg=Hi"}
$ docker container run --rm ghcr.io/h4l/json.bash/jb "msg=\=Hi"
{"msg":"\\=Hi"}
$ docker container run --rm ghcr.io/h4l/json.bash/jb "msg\==\=Hi"
{"msg\\=\\":"Hi"}
$ docker container run --rm ghcr.io/h4l/json.bash/jb "msg\\==\=Hi"
{"msg\\=\\":"Hi"}
$ docker container run --rm ghcr.io/h4l/json.bash/jb "msg\\===Hi"
{"msg\\=":"Hi"}