title: Tree structure in javascript with Json formatter
body: <pre><code>author: [
              {
                  id: '1',
                  code: 'ghj:aws:aws_vpc:create',
                  description: 'Permission to create',
                  status: 'ACTIVE',
                  scope: 'PROVIDER'
              },
              {
                  id: '2',
                  code: 'ghj:aws:aws_vpc:update',
                  description: 'Permission to create',
                  status: 'ACTIVE',
                  scope: 'PROVIDER'
              },
              {
                  id: '3',
                  code: 'ghj:aa:aa:update',
                  description: 'Permission',
                  status: 'ACTIVE',
                  scope: 'PROVIDER'
              },
              {
                  id: '4',
                  code: 'dusk:resource-management:compute:ip:list',
                  description: 'Permission',
                  status: 'ACTIVE',
                  scope: 'PROVIDER'
              },
              {
                  id: '5',
                  code: 'dusk:resource-management:storage:disk:delete',
                  description: 'Permission',
                  status: 'ACTIVE',
                  scope: 'PROVIDER'
              },
              {
                  id: '6',
                  code: 'dusk:resource-management:storage:disk:Update',
                  description: 'Permission',
                  status: 'ACTIVE',
                  scope: 'PROVIDER'
              }
  ]
  </code></pre>
  <p>i want to convert this tree structure like this in javascript</p>
  <pre><code>[
      {
        text: 'ghj',
        children: [
          {
            text: 'aws',
             children: [
             {
            text: 'aws_vpc',
            children: [
              {
                text: 'create'
              },
              {
                text: 'Update'
              }
            ]
          }
          ]
          
          },
            {
            text: 'aa',
             children: [
             {
            text: 'aa',
            children: [
            
              {
                text: 'Update'
              }
            ]
          }
          ]
          
          }
        ]
      }
  ]
  </code></pre>