Input JSON
{
'abc': [{
'stores':[{
'myproperty':true
}],
'list':[{
'listname':'mylist',
'listid': 'list1'
}],
'address': {
'name':'george street'
}
}]
}
Output JSON
{
'abc': [
{
myproperty: true,
listname: 'mylist',
listid: 'list1',
address: 'george street'
}
]
}
Need to consider only the first object in the array.
const transformArray = R.pipe(R.identity, R.applySpec({
abc: R.pipe(R.prop('abc'), R.map(x => {
return x.stores[0].myproperty
}))
}));
New to Ramdajs, trying the build the functional code