function encode
Encode a value to a JSON string. Mirrors the Starlark stdlib’s
json.encode, with an additional optional indent parameter: pass a non-negative integer to pretty-print the output with that many spaces of indentation per nesting level (newlines inserted between elements). Omitting indent produces the stdlib’s compact single-line form.
function decode
Decode a JSON string. Raises on parse failure. Mirrors the Starlark stdlib’s
json.decode. Use try_decode instead at I/O boundaries where a malformed input would otherwise crash the caller.
function try_decode
Decode a JSON string. Returns
default (None by default) on parse failure instead of raising. Distinguishing “parse failed” from “valid null parse”: both produce None unless the caller passes a sentinel default.

