title: Parse URL-like data to json in javascript
body: <p>Can anyone show me how to parse an array of URL-like data to json?</p>
  
  <p>Array <code>["a.b.c.d","a.c.e.f","a.b.c.g"]</code> to this kind of json:</p>
  
  <pre><code>items:{
      text: "a",
      items:[
          {
              text:"b",   
              items:[
              {
                  text:"c",
                  items:[
                  {
                      text:"d",
                      leaf:true
                  },
                  {
                      text:"g",
                      leaf:true
                  }
                  ]
  
              }
              ]
          },
          {
              text:"c",
              items:[
              {
                  text:"e",
                  items:[
                  {
                      text:"f",
                      leaf:true
                  }
                  ]
              }
              ]
          }
      ]
  }
  </code></pre>