Case insensitive query parameters names
michaeluskov opened this issue · comments
Michael Uskov commented
Hello everyone!
At first, thank you for that library.
Is there any way to make path-parser treat query parameters in the case-insensitive way?
import Path from 'path-parser';
const path = new Path('/users?offset&limit');
document.write(JSON.stringify(path.test('/users?limIt=15')));
document.write("<br>");
document.write(JSON.stringify(path.test('/users?limIt=15', { caseSensitive: false })));
Will write
null
null
But I want to get {limit: '15'}
.
How can I do it?
Thomas Roch commented
Hello, currently the case sensitive functionality is not on parameter names and values, but on the static part of a defined URL. Not something I have the time to commit to right now, but you're welcome to raise a PR for it.