This pattern reverses key-value pairs when the value is a string.
Apply with the Grit CLI
grit apply reverse_json_kv
Matches a key-value pair
BEFORE
{ "foo": 5, "bar": "buz" }
AFTER
{ "foo": 5, "buz": "bar" }
This pattern reverses key-value pairs when the value is a string.
grit apply reverse_json_kv
{ "foo": 5, "bar": "buz" }
{ "foo": 5, "buz": "bar" }