Problem:
Given that I have the following "name" and "value" strings:
<input type="text" name="attributes[options][0][label]" value="Test Option">
<input type="text" name="attributes[options][0][value]" value="test-option">
<input type="text" name="attributes[options][1][label]" value="Another Test Option">
<input type="text" name="attributes[options][1][value]" value="another-test-option">
How do I convert to the following JSON format?
attributes: {
options: [
{
label: "Test Option",
value: "test-option",
},
{
label: "Another Test Option",
value: "another-test-option",
},
],
}