Hacker News new | ask | show | jobs
by stekoz 4646 days ago
Any idea of how this compares to purl.js ? https://github.com/allmarkedup/purl
1 comments

We just thought it did too much for what we needed. It's a great library, and if I were parsing URLs in my apps I'd use it. But we just wanted a single get() interface and support for complex objects in the URL.

Arg.js turns an object like this:

    {
      tags: ["one", "two", "three"],
      deep: {
        nested: {
          objects: true
        }
      }
    }
into this:

    #?tags[0]=one&tags[1]=two&tags[2]=three&deep.nested.objects=true
... and vice-versa