javascript – Optimize double reduced and double maps of nested objects

I need to optimize this javascript method as it is a little slow. I do not want to use the flat () command, because for some reason my angular6 app does not understand the vanilla flat () command, or displays annoying warning messages.

So check the below:

  1. my object of origin
  2. my desired result object
  3. my slow solution (works, but is slow)

1. my purpose of origin:

        const data [
      {
        "id": 1,
        "name": "Application",
        "groups": [
          {
            "groupName": "",
            "configurations": [
              {
                "id": 17,
                "icon": "access_time",
                "title": "Daily Order Cut-Off Time",
                "description": "Daily Order Cut-Off Time",
                "code": "daily-order-cut-off-time",
                "value": "09:35",
                "valueType": "Time",
                "configurationTypeId": 11,
                "definition": {
                  "step": "none"
                },
                "isDefault": false
              }
            ]
          }
]}
{
"id": 3,
"name": "Treatment",
"groups": [
          {
            "groupName": "",
            "configurations": [
              {
                "id": 1078,
                "icon": "flash_on",
                "title": "Auto Process",
                "description": "Will process all orders that are in the same batch",
                "code": "processing-auto-process",
                "value": "0",
                "valueType": "Boolean",
                "configurationTypeId": 6,
                "definition": null,
                "isDefault": false
              },
              {
                "id": 1074,
                "icon": "subdirectory_arrow_right",
                "title": "Allow Under Picking",
                "description": "Allow under pick when processing order?",
                "code": "processing-allow-under-picks",
                "value": "0",
                "valueType": "Boolean",
                "configurationTypeId": 6,
                "definition": null,
                "isDefault": false
              }
            ]
          }
]}
];

2. desired object:

 [
      {
        "id": 17,
        "code": "daily-order-cut-off-time",
        "value": "09:35"
      },
      {
        "id": 1078,
        "code": "processing-auto-process",
        "value": "0"
      },
      {
        "id": 1074,
        "code": "processing-allow-under-picks",
        "value": "0"
      }
    ]

My slow solution:

const result = data.map (module => module.groups.map (configurations => configurations.configurations.map (config => ({id: config.id, code: config.code, value: config.value})) reduce) ((l, n) => l.concat (n), []) .reduce ((l2, n2) => l2.concat (n2),[]));