jsUri icon indicating copy to clipboard operation
jsUri copied to clipboard

Case insensitivity implemented - by storing key in lower case

Open PandaWood opened this issue 8 years ago • 2 comments

I stored the key as lower case, to avoid adding a load of toLowerCase statements - though I still needed a few. I tried using a case-insensitive regex but it fails one important test that deals with encoding, so toLowerCase it is I've also removed forEach - it's time to let go - I'll understand if you don't want this. But I'll keep it on my fork

These commits need to be squashed, only the last implements the idea of storing the key lower case

PandaWood avatar Feb 09 '17 11:02 PandaWood

@PandaWood sorry it has taken so long to address this - are you still interested in discussing? There are some aspects of the spec that assuming case insensitivity violates, and so I'm wondering if we can do a constructor switch or something.

derek-watson avatar Aug 07 '17 14:08 derek-watson

Hi @derek-watson , Right, I suppose a constructor arg might be the only way then, although probably be a little awkward eg something like new Uri({nocase: true}, url).getQueryParam('bob')

PandaWood avatar Aug 22 '17 06:08 PandaWood