jsUri icon indicating copy to clipboard operation
jsUri copied to clipboard

[WIP] Add caseSensitive option for query param keys matching

Open faridnsh opened this issue 8 years ago • 1 comments

Fixes #57.

This is basically what was requested in #57, it adds a setter, .caseSensitive. Have a look at the test case. Then when query param keys are being matched, it should take that into account.

Right now, only getQueryParamValue and getQueryParamValues are changed but I believed other places such as deleteQueryParam, hasQueryParam and replaceQueryParam should also be changed for consistent behavior.

@derek-watson Tell me what you think about this, if you think this method is OK, I'm going to complete this.

faridnsh avatar Feb 07 '17 04:02 faridnsh

Hey Alfred,

I just added a pull request as well - partly to show a different way. I've implemented case insensitivity for everything, as you proposed (eg hasQueryParamValue, deleteParamValue)

To prevent oodles of toLowerCase() everywhere, I stored the key lower case). I still needed a few extra toLowerCase() calls though

All the existing tests pass and I added 4 or 5 that test for case insensitivity on all those methods.

PandaWood avatar Feb 09 '17 11:02 PandaWood