Ramda弯角到达嵌套路径

时间:2018-11-01 18:58:19

标签: ramda.js

我是Ramda的新手,有以下问题...我有一个json文件,如下所示

{
"name": "Alarms",   
"props": {
    "filterPropertyName": {
        "value": "CompositeDataTypeName"
    },
    "children": {
        "collection": [{
            "name": "Adjustment Proximity Switch Failure Alarm",
            "parent": {
                "propName": "Children",
                "propType": "c",
                      ........

我用过

notificationKeys = r.pipe(r.view(r.lensPath([entitiesSelectorName, 'alarms'])), r.keys);

获取“名称”:“调整接近开关故障警报”,

如果有时json文件如下,

{
"name": "Alarms",
"props": {
    "filterPropertyName": {
        "value": "CompositeDataTypeName"
    },
    "children": {
        "collection": [{
            "name": "Alarm Bits Dint01",
            "parent": {
                "propName": "Children",
                "propType": "c",
                "hidden": true
            },
            "props": {
                "bits": {
                    "collection": [{
                        "name": "BELT SLIP ALARM",
                        "parent": {
                            "propName": "Bits",
                            "propType": "c",
                            "hidden": false
                        },
                        "type.........

notificationKeys使我进入“名称”:“ Alarm Bits Dint01”。...如何获得“名称”:“ BELT SLIP ALARM”,

任何帮助将不胜感激。

0 个答案:

没有答案