title: Convert inregular obejct to sipmle object
body: <p>I wan to convert irregular object ({{}, [] ...}) to an object consisting only of simple objects</p>
  
  <p>I have this:</p>
  
  <pre><code>{
      "mname": "u1",
      "tab": [
          {
              "sname": "u2",
              "intab": [
                  {
                      "l": 1,
                      "m": 3
                  },
                  {
                      "l": 2,
                      "m": 3
                  },
              ]
          },
          {
              "sname": "u2",
              "intab": [
                  {
                      "l": 1,
                      "m": 3
                  },
                  {
                      "l": 2,
                      "m": 4
                  }
              ]
          }
      ]
  }
  </code></pre>
  
  <p>but I want something like that: </p>
  
  <pre><code>{
      "mname": "u1",
      "tab": {
          {
              "sname": "u2",
              "intab": {
                  {
                      "l": 1,
                      "m": 3
                  },
                  {
                      "l": 2,
                      "m": 3
                  },
              }
          },
          {
              "sname": "u2",
              "intab": {
                  {
                      "l": 1,
                      "m": 3
                  },
                  {
                      "l": 2,
                      "m": 4
                  }
              }
          }
      }
  }
  </code></pre>
  
  <p>Generally, convert everything to objects in one main object</p>
  
  <p>I suspect that this can be using the reduce function but in this case, because it is not a regular array of {key: value} objects, I can't handle it</p>