I want to find particular key value is nested object or not.
{
'a': {
'area': 'abc'
},
'b': {
'area': {
'city': 'aaaa',
'state': 'ggggg'
}
}
}
In above example, I want to find 'a' and 'b' is object or nested object?
If you want to know whether all keys in the object contain nested objects then one possible solution is to convert all of the values of the object to boolean values using
R.map
andR.propSatisfies
, representing whether the nested property was an object or not.If you just want to know whether a specific key of an object contains a nested object, then you can do so with a composition of
R.prop
andR.propSatisfies
.