A little library that recursively converts an object with arrays to an object with objects.
yarn add @retrohacker/objectifyobjectify({
'foo': [
{ 'a': 1 },
{ 'b': 2 }]
}
)yields
{
'foo': {
'foo_0': { 'a': 1 },
'foo_1': { 'b': 2 }
}
}and
{
'foo': [1, 2, 3],
'bar': ['a', 'b', 'c']
}yields
{
'foo': [1, 2, 3],
'bar': ['a', 'b', 'c']
}