Re: [whatwg] URL: URLQuery

On Friday, October 12, 2012 at 6:24 PM, Tab Atkins Jr. wrote:

> On Fri, Oct 12, 2012 at 9:10 AM, Anne van Kesteren <annevk@annevk.nl> wrote:
> > I didn't really get around to working on URLs this week like I
> > planned, but I managed to draft the query API that was discussed in
> > the last thread:
> >  
> > http://url.spec.whatwg.org/#urlutils
> >  
> > get() returns the first value. getAll() returns all values. set()
> > either sets a single or multiple values. delete() well, deletes.
> >  
> > Based on discussion in #whatwg
> > http://krijnhoetmer.nl/irc-logs/whatwg/20121012#l-981 I did not go
> > with a design that would require proxies when implemented in
> > JavaScript.
> >  
> > Having said that, nothing is set in stone, bikeshed away! ;-)
>  
> I definitely prefer the "design that would require proxies" - it feels
> more natural to me. Glenn outlined a reasonable way to still mix in
> the "getAll()" idiom.
>  
> If we do stick with the method-based map, I strongly feel we should
> match the JS Map API, and have a has() method as well. *Ideally*,
> this would be a subclass of Map.
>  
>  

That's awesome, I'm actually in the middle of writing up a mini-proposal for this using Map—looking at the current design it's basically an identical API, and of you want getAll()...

Array.from(URLQuery)  
[ [key, val], [...]]

I suspect spread will be upgraded as well (to allow conversion of iterables)

Rick
  
>  
> ~TJ  

Received on Friday, 12 October 2012 23:14:50 UTC