W3C home > Mailing lists > Public > whatwg@whatwg.org > October 2012

Re: [whatwg] URL: URLQuery

From: Rick Waldron <waldron.rick@gmail.com>
Date: Fri, 12 Oct 2012 19:14:10 -0400
To: "Tab Atkins Jr." <jackalmage@gmail.com>
Message-ID: <36C9753C67BA4845BE5C34BF9697DBD3@gmail.com>
Cc: WHATWG <whatwg@whatwg.org>



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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 30 January 2013 18:48:11 GMT