Re: URL and host comparison methods

On Tue, Aug 18, 2015 at 11:25 PM, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
> Foo.isFoo() is idiomatically used as an instance tester.  That's not
> quite URL.is(), but it's close enough that it might be good to use
> different names.

I was basing this on Object.is() and the lack of a Host object made me
go for URL.hostIs() since we store other methods for hosts there too.


> Why not .matches() and .hostMatches()?  You're *comparing* two urls, after all.

We use matches() on instances, not as statics on classes. That does
not work well for hosts and I'm not sure I would want to force folks
to create a URL instance in order to compare a string as URL.


-- 
https://annevankesteren.nl/

Received on Wednesday, 19 August 2015 06:51:50 UTC