redux-query-sync icon indicating copy to clipboard operation
redux-query-sync copied to clipboard

Case insensitive matches

Open tiagogm opened this issue 7 years ago • 3 comments

Hello!

Firstly, thank you for working on this! It's coming in very handy.

I have a question of sorts. I know that per RFC rules, querystrings are case sensitive.

However, in specific use cases, it would be useful to configure the enhancer params matching to be case insensitive. In my particular case, I'm in the process of migrating from pascal case to lower case and wanted the params to match both cases.

If you're open to the idea, I would be happy to submit a PR.

tiagogm avatar Apr 11 '18 15:04 tiagogm

I would probably just specify stringToValue: s => s.toLowerCase() for every parameter; would that solve the problem? Or is the problem that you consider it too cumbersome to repeat that line for every parameter?

Treora avatar Apr 11 '18 15:04 Treora

Oh wait, I am talking about values; you are talking about parameter names; sorry. :)

In that case, perhaps that would be a valid request indeed.

Treora avatar Apr 11 '18 15:04 Treora

Yeah 😄 I meant case insensitive query string keys. So that param p matched both P and p in the url.

Cool! As soon as I have hour or so I'll submit a PR 👍

tiagogm avatar Apr 11 '18 16:04 tiagogm