Flatten nested JSON to dot-path keys, or unflatten dot-path keys back to nested JSON. mode: flatten (default) | unflatten.