troch / path-parser

A small utility to parse paths.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Arrays in path

micha149 opened this issue · comments

I already asked on the router5 gitter room, but got no response. I think my question is at first related to path-parser.

Is it possible to match a route/url with multiple occurrences of the same param to an array?!
For example: I need to turn a url like /users?filter=foo&filter=bar into a params object which looks like {filter: ['foo', 'bar']}.

Or is there any other pattern for handling arrays without doing manual string splitting?!

Hi @micha149

Github is the place to get me. I opened a chat room because asked to do so, but I rarely go there.
I will implement this very soon. Another way to do it would be: /users?filter[]=foo&filter[]=bar, I'll also support that syntax.

What means very soon? Can I help to speed up development of this feature? I am asking because we are currently starting a new project and plan to use router5 instead of angular ui-router. But this feature is very important for our application.

Very soon means I'll dev it tonight, and release tomorrow or tonight depending on how I get on with it.

This sounds awesome!

Supported (now v0.4.2). I'll need tomorrow to apply it to route-node, running into a few issues.